}
private static String fieldNameFromAnnotations(Annotation[] annotations) {
for (Annotation annotation : annotations) {
if (annotation.annotationType() == FormField.class) {
FormField formFieldAnnotation = (FormField) annotation;
return formFieldAnnotation.value();
}
}
throw new IllegalArgumentException(
"Annotation list does not contain FormField annotation.");
}