Example usage for Java org.springframework.util ReflectionUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
MethodFilter | USER_DECLARED_METHODS Pre-built MethodFilter that matches all non-bridge non-synthetic methods which are not declared on java.lang.Object . |
FieldFilter | COPYABLE_FIELDS Pre-built FieldFilter that matches all non-static, non-final fields. |
void | clearCache() Clear the internal method/field cache. |
boolean | declaresException(Method method, Class> exceptionType) Determine whether the given method explicitly declares the given exception or one of its superclasses, which means that an exception of that type can be propagated as-is within a reflective invocation. |
void | doWithFields(Class> clazz, FieldCallback fc) Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields. |
void | doWithFields(Class> clazz, FieldCallback fc, @Nullable FieldFilter ff) Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields. |
void | doWithLocalFields(Class> clazz, FieldCallback fc) Invoke the given callback on all locally declared fields in the given class. |
void | doWithLocalMethods(Class> clazz, MethodCallback mc) Perform the given callback operation on all matching methods of the given class, as locally declared or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements). |
void | doWithMethods(Class> clazz, MethodCallback mc) Perform the given callback operation on all matching methods of the given class and superclasses. |
void | doWithMethods(Class> clazz, MethodCallback mc, @Nullable MethodFilter mf) Perform the given callback operation on all matching methods of the given class and superclasses (or given interface and super-interfaces). |
Field | findField(Class> clazz, String name) Attempt to find a Field field on the supplied Class with the supplied name . |
Field | findField(Class> clazz, @Nullable String name, @Nullable Class> type) Attempt to find a Field field on the supplied Class with the supplied name and/or Class type . |
Method | findMethod(Class> clazz, String name, @Nullable Class>... paramTypes) Attempt to find a Method on the supplied class with the supplied name and parameter types. |
Method | findMethod(Class> clazz, String name) Attempt to find a Method on the supplied class with the supplied name and no parameters. |
Method[] | getAllDeclaredMethods(Class> leafClass) Get all declared methods on the leaf class and all superclasses. |
Object | getField(Field field, @Nullable Object target) Get the field represented by the supplied Field field object on the specified Object target object . |
Method[] | getUniqueDeclaredMethods(Class> leafClass) Get the unique set of declared methods on the leaf class and all superclasses. |
void | handleInvocationTargetException(InvocationTargetException ex) Handle the given invocation target exception. |
void | handleReflectionException(Exception ex) Handle the given reflection exception. |
Object | invokeMethod(Method method, @Nullable Object target) Invoke the specified Method against the supplied target object with no arguments. |
Object | invokeMethod(Method method, @Nullable Object target, @Nullable Object... args) Invoke the specified Method against the supplied target object with the supplied arguments. |
boolean | isEqualsMethod(@Nullable Method method) Determine whether the given method is an "equals" method. |
boolean | isHashCodeMethod(@Nullable Method method) Determine whether the given method is a "hashCode" method. |
boolean | isObjectMethod(@Nullable Method method) Determine whether the given method is originally declared by java.lang.Object . |
boolean | isPublicStaticFinal(Field field) Determine whether the given field is a "public static final" constant. |
boolean | isToStringMethod(@Nullable Method method) Determine whether the given method is a "toString" method. |
void | makeAccessible(Constructor> ctor) Make the given constructor accessible, explicitly setting it accessible if necessary. |
void | makeAccessible(Method method) Make the given method accessible, explicitly setting it accessible if necessary. |
void | makeAccessible(Field field) Make the given field accessible, explicitly setting it accessible if necessary. |
void | rethrowException(Throwable ex) Rethrow the given Throwable exception , which is presumably the target exception of an InvocationTargetException . |
void | rethrowRuntimeException(Throwable ex) Rethrow the given Throwable exception , which is presumably the target exception of an InvocationTargetException . |
void | setField(Field field, @Nullable Object target, @Nullable Object value) Set the field represented by the supplied Field field object on the specified Object target object to the specified value . |