List<AnnotationData> extractValidationAnnotationData = AnnotationUtils.extractValidationAnnotationData((Annotation[]) values, allowedPackages);
for (AnnotationData ad : extractValidationAnnotationData) {
if (propertyName.equals(ad.getValues().get("name"))) {
if (ad.getValues().get("column") != null) {
ad = new AnnotationData((Annotation) ad.getValues().get("column"), allowedPackages);
Object object = ad.getValues().get("length");
if (object != null) {
found = true;
Integer length = (Integer) object;
return length.intValue();
}
}
}
}
}
map = getAnnotationDataAsMap( clazz, propertyName );
found = map.get( "column" ) != null;
/* If you found an annotation called required, return true. */
if (found) {
/*
* If the column annotation data was found, see if the length
* flag was set.
*/
AnnotationData ad = (AnnotationData) map.get( "column" );
Object object = ad.getValues().get("length");
/* If the nullable flag was set, return its value. */
if (object != null) {
Integer length = (Integer) object;
return length.intValue();
}