public abstract class FieldUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
FieldUtils.FieldCallback
Callback interface invoked on each field in the hierarchy.
|
| 构造器和说明 |
|---|
FieldUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
doWithFields(Class<?> clazz,
FieldUtils.FieldCallback fc)
Invoke the given callback on all fields in the target class, going up the
class hierarchy to get all declared fields.
|
static void |
makeAccessible(Field field)
Make the given field accessible, explicitly setting it accessible if
necessary.
|
public static void doWithFields(Class<?> clazz, FieldUtils.FieldCallback fc)
clazz - the target class to analyzefc - the callback to invoke for each fieldIllegalStateException - if introspection failspublic static void makeAccessible(Field field)
setAccessible(true) method is only called
when actually necessary, to avoid unnecessary conflicts with a JVM
SecurityManager (if active).field - the field to make accessibleAccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)Copyright © 2023. All rights reserved.