public class AnnotationValidatorMetaDataReader extends Object implements ValidatorMetaDataReader, Serializable
AnnotationValidatorMetaDataReader reads validation meta-data from annotation.
This class reads a annotation as follows: You pass in the base package of the
annotation it defaults to "org.boon.annotation.validation". It then takes
the name of the ValidatorMetaData and
capitalizes the first letter. Thus if you pass the package
"com.my.company.annotation", and
ValidatorMetaData.name = "required", then it will look for an
annotation called com.my.company.annotation.Required. The idea behind this is
that you can use annotation without polluting your model classes with Boon
annotation.
The parent class that owns the annotation should have annotation as follows:
| Constructor and Description |
|---|
AnnotationValidatorMetaDataReader() |
| Modifier and Type | Method and Description |
|---|---|
List<ValidatorMetaData> |
readMetaData(Class<?> clazz,
String propertyName)
Read the meta-data from annotation.
|
void |
setValidationAnnotationPackages(Set<String> validationAnnotationPackages)
We allow a set of validation annotation packages to be configured.
|
public List<ValidatorMetaData> readMetaData(Class<?> clazz, String propertyName)
readMetaData in interface ValidatorMetaDataReaderclazz - The class that contains the annotation.propertyName - The name of the property that we are reading
the annotation meta-data from.Copyright © 2015. All Rights Reserved.