@Test public void test_locateById_NotFoundField() { assertNull(locator.locateById(Dummy.class, "doesNotExist")); }
public ReflectionField locateById(Class<?> clazz, String id) { for (java.lang.reflect.Field field : locateAnnotated(clazz, Field.class)) { String annotationValue = field.getAnnotation(Field.class).value(); if (!isEmpty(annotationValue) && id.equals(annotationValue)) { return new ReflectionField(field); } else if (isEmpty(annotationValue) && (field.getName().equals(id) || field.getName().equals(convertIdIntoJavaFieldName(id)))) { return new ReflectionField(field); } } return null; }
FieldLocator { public ReflectionField locateById(Class<?> clazz, String id) { for (java.lang.reflect.Field field : locateAnnotated(clazz, Field.class)) { String annotationValue = field.getAnnotation(Field.class).value(); if (!isEmpty(annotationValue) && id.equals(annotationValue)) { return new ReflectionField(field); } else if (isEmpty(annotationValue) && (field.getName().equals(id) || field.getName().equals(convertIdIntoJavaFieldName(id)))) { return new ReflectionField(field); } } return null; } }
FieldLocator { public ReflectionField locateById(Class<?> clazz, String id) { for (java.lang.reflect.Field field : locateAnnotated(clazz, Field.class)) { String annotationValue = field.getAnnotation(Field.class).value(); if (!isEmpty(annotationValue) && id.equals(annotationValue)) { return new ReflectionField(field); } else if (isEmpty(annotationValue) && (field.getName().equals(id) || field.getName().equals(convertIdIntoJavaFieldName(id)))) { return new ReflectionField(field); } } return null; }  }
FieldLocator { public ReflectionField locateById(Class<?> clazz, String id) { for (java.lang.reflect.Field field : locateAnnotated(clazz, Field.class)) { String annotationValue = field.getAnnotation(Field.class).value(); if (!isEmpty(annotationValue) && id.equals(annotationValue)) { return new ReflectionField(field); } else if (isEmpty(annotationValue) && (field.getName().equals(id) || field.getName().equals(convertIdIntoJavaFieldName(id)))) { return new ReflectionField(field); } } return null; }  List<String> gatherFieldIds(Class<?> clazz); ReflectionField locateById(Class<?> clazz, String id); }
FieldLocator { public ReflectionField locateById(Class<?> clazz, String id) { for (java.lang.reflect.Field field : locateAnnotated(clazz, Field.class)) { String annotationValue = field.getAnnotation(Field.class).value(); if (!isEmpty(annotationValue) && id.equals(annotationValue)) { return new ReflectionField(field); } else if (isEmpty(annotationValue) && (field.getName().equals(id) || field.getName().equals(convertIdIntoJavaFieldName(id)))) { return new ReflectionField(field); } } return null; }  List<String> gatherFieldIds(Class<?> clazz); ReflectionField locateById(Class<?> clazz, String id);  }