public void validate(Map<String, Object> map, Class<?> annotation) { ArrayList<String> notAssignedAttributes = null; Method[] methods = getDeclaredMethods(annotation); for (int i = 0 ; i < methods.length ; i++) { if (map.get(methods[i].getName()) == null) { if (notAssignedAttributes == null) { notAssignedAttributes = new ArrayList<String>(); } notAssignedAttributes.add(methods[i].getName()); } } if (notAssignedAttributes != null) { throw new AnnotationValidationException("Unable to fill in default attributes for " + annotation + " " + notAssignedAttributes); } }
public void validate(Map map, Class annotation) { ArrayList<String> notAssignedAttributes = null; Method[] methods = getDeclaredMethods(annotation); for (int i = 0 ; i < methods.length ; i++) { if (map.get(methods[i].getName()) == null) { if (notAssignedAttributes == null) { notAssignedAttributes = new ArrayList<String>(); } notAssignedAttributes.add(methods[i].getName()); } } if (notAssignedAttributes != null) { throw new AnnotationValidationException("Unable to fill in default attributes for " + annotation + " " + notAssignedAttributes); } }