AbstractReflection¶
- public abstract class org.apache.commons.lang3.builder.AbstractReflection[source]¶
Abstracts reflection access for reflection-based classes in this package.
See
AbstractReflection.AbstractBuilder.setForceAccessible(boolean)for details.
Methods¶
|
Gets whether the system property |
|
|
Tests whether fields should be made accessible with |
|
|
|
Sets |
- public static boolean getForceAccessible()[source]¶
Gets whether the system property
"AbstractReflection.forceAccessible"is set to true.The parsing rules are defined by
Boolean.parseBoolean(String).If the property is not set, return true.
- Returns:
whether the system property
"AbstractReflection.forceAccessible"is set to true with true as the default.- Since:
3.21.0
- See also:
- protected boolean isForceAccessible()[source]¶
Tests whether fields should be made accessible with
AccessibleObject.setAccessible(boolean).- Returns:
whether fields should be made accessible with
AccessibleObject.setAccessible(boolean).
- public static boolean setAccessible(boolean forceAccessible, AccessibleObject accessibleObject)[source]¶
Sets
accessibleObjectto be accessible ifforceAccessibleis true and the object is not already accessible. CallsAccessibleObject#setAccessible(true).- Parameters:
forceAccessible – Whether to call
AccessibleObject.setAccessible(boolean)if the object is not already accessible.accessibleObject – The accessible object to set; may be
null.
- Returns:
trueifaccessibleObjectis non-null and accessible after this call;falseotherwise (including whenaccessibleObjectisnull, or when it is inaccessible andforceAccessibleisfalse).- Throws:
SecurityException– Thrown ifforceAccessibleis true and the request is denied.- See also: