/** * This method return all the fields (including private) from the given class and its super * classes. * * @param fieldClass Class * @return List<Field> * @should return all fields include private and super classes */ public static List<Field> getAllFields(Class<?> fieldClass) { List<Field> fields = ClassDataCacher.getInstance().getClassData(fieldClass).getFields(); return new ArrayList<>(fields); }
/** * This method returns true if the given annotation is present on the given field. * * @param fieldClass * @param fieldName * @param annotation * @return true if the given annotation is present */ public static boolean isAnnotationPresent(Class<?> fieldClass, String fieldName, Class<? extends Annotation> annotation) { ClassFields<?> classFields = ClassDataCacher.getInstance().getClassFields(fieldClass); try { return classFields.getFieldAnnotation(annotation, fieldName) != null; } catch (FieldnameNotFoundException e) { return false; } }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
protected ClassDataCacher getClassDataCacher() { return ClassDataCacher.getInstance(); }
} else { ClassData<?> cd = ClassDataCacher.getInstance().getClassData(annotation); List<Method> methods = cd.getMethods(); for (Method method : methods) { } else { ClassData<?> cd = ClassDataCacher.getInstance().getClassData(annotation); List<Method> methods = cd.getMethods(); for (Method method : methods) {
} else { ClassData<?> cd = ClassDataCacher.getInstance().getClassData(annotation); List<Method> methods = cd.getMethods(); for (Method method : methods) { } else { ClassData<?> cd = ClassDataCacher.getInstance().getClassData(annotation); List<Method> methods = cd.getMethods(); for (Method method : methods) {