On this page

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.

Since:

3.21.0

See also:

Methods

static boolean

getForceAccessible()

Gets whether the system property "AbstractReflection.forceAccessible" is set to true.

protected boolean

isForceAccessible()

Tests whether fields should be made accessible with AccessibleObject.setAccessible(boolean).

static boolean

setAccessible(boolean forceAccessible, AccessibleObject accessibleObject)

Sets accessibleObject to be accessible if forceAccessible is true and the object is not already accessible.

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:

Boolean.parseBoolean(String)

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 accessibleObject to be accessible if forceAccessible is true and the object is not already accessible. Calls AccessibleObject#setAccessible(true).

Parameters:
Returns:

true if accessibleObject is non-null and accessible after this call; false otherwise (including when accessibleObject is null, or when it is inaccessible and forceAccessible is false).

Throws:

SecurityException – Thrown if forceAccessible is true and the request is denied.

See also: