public class PropertiesFileValidatorMetaDataReader extends Object implements ValidatorMetaDataReader
PropertiesFileValidatorMetaDataReader reads validation meta-data from a properties files.
This class reads a properties file as follows:
If the class name is com.foo.Foo, then the resource name is
com.foo.Foo.properties.
The properties file will contain validation meta-data as follows:
firstName=required; length min=10, max=100 age=required; range min=10, max=100The firstName corresponds to a property of the Foo class. The firstName is associated with the validation rules required and length. The length validation rule states the minimum and maximum allowed number of characters with the min and max parameters.
Two different frameworks read this meta-data (curently). Our validation framework, which is mostly geared towards server-side validation and our client-side JavaScript framework, which is geared towards producing client-side JavaScript.
Constructor and Description |
---|
PropertiesFileValidatorMetaDataReader() |
Modifier and Type | Method and Description |
---|---|
List<ValidatorMetaData> |
readMetaData(Class<?> clazz,
String propertyName)
Read the meta-data from a properties file.
|
public PropertiesFileValidatorMetaDataReader()
public List<ValidatorMetaData> readMetaData(Class<?> clazz, String propertyName)
readMetaData
in interface ValidatorMetaDataReader
Copyright © 2014. All rights reserved.