Annotation[] anotations = method.getAnnotations();
for (Annotation annotation : anotations) {
if (Property.class.equals(annotation.annotationType())
|| Reference.class.equals(annotation.annotationType())) {
if (found) {
MetaDataException e = new MetaDataException("Method cannot specify both property and reference");
e.setIdentifier(method.getName());
throw e;
}
found = true;
}
}
}
// validate fields do not contain both @Reference and @Property annotations
Set<Field> fields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(clazz);
for (Field field : fields) {
found = false;
Annotation[] anotations = field.getAnnotations();
for (Annotation annotation : anotations) {
if (Property.class.equals(annotation.annotationType())
|| Reference.class.equals(annotation.annotationType())) {
if (found) {
MetaDataException e = new MetaDataException("Field cannot specify both property and reference");
e.setIdentifier(field.getName());
throw e;
}
found = true;
}
}