public class FieldUtils
extends java.lang.Object
| 构造器和说明 |
|---|
FieldUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.util.List<java.lang.Class<?>> |
getAllInterfaces(java.lang.Class<?> cls)
Gets a
List of all interfaces implemented by the given
class and its superclasses. |
static java.lang.reflect.Field |
getField(java.lang.Class<?> cls,
java.lang.String fieldName,
boolean forceAccess)
Gets an accessible
Field by name, breaking scope if requested. |
public static java.lang.reflect.Field getField(java.lang.Class<?> cls,
java.lang.String fieldName,
boolean forceAccess)
Field by name, breaking scope if requested. Superclasses/interfaces will be
considered.cls - the Class to reflect, must not be nullfieldName - the field name to obtainforceAccess - whether to break scope restrictions using the
AccessibleObject.setAccessible(boolean) method. false will only
match public fields.java.lang.IllegalArgumentException - if the class is null, or the field name is blank or empty or is matched at multiple places
in the inheritance hierarchypublic static java.util.List<java.lang.Class<?>> getAllInterfaces(java.lang.Class<?> cls)
Gets a List of all interfaces implemented by the given
class and its superclasses.
The order is determined by looking through each interface in turn as declared in the source file and following its hierarchy up. Then each superclass is considered in the same way. Later duplicates are ignored, so the order is maintained.
cls - the class to look up, may be nullList of interfaces in order,
null if null inputCopyright © 2023. All Rights Reserved.