On this page

AbstractReflection.AbstractBuilder

public abstract static class org.apache.commons.lang3.builder.AbstractReflection.AbstractBuilder<B extends AbstractReflection.AbstractBuilder<B>> implements Supplier<AbstractReflection>[source]

Builds an instance of a subclass of AbstractReflection.

Parameters:

<B> – An AbstractBuilder subclass.

Methods

asThis()

Returns this instance typed as its subclass.

setForceAccessible(boolean)

Sets whether inaccessible fields are made accessible by calling AccessibleObject#setAccessible(true).

@SuppressWarnings({"unchecked"}) protected B asThis()[source]

Returns this instance typed as its subclass.

Returns:

this instance typed as its subclass.

public B setForceAccessible(boolean forceAccessible)[source]

Sets whether inaccessible fields are made accessible by calling AccessibleObject#setAccessible(true).

In general, controls whether the instances built by this builder will force the accessible flag for reflection.

Defaults to getForceAccessible(), which defaults to true for compatibility.

This default is read from the system property "AbstractReflection.forceAccessible", which defaults to true for compatibility.

The parsing rules are defined by Boolean#parseBoolean(String).

See subclasses for specific behavior.

Parameters:

forceAccessible – Whether to force accessibility by calling AccessibleObject#setAccessible(true).

Returns:

this instance.

See also:

AccessibleObject#setAccessible(boolean)