| Modifier and Type | Method and Description |
|---|---|
<T> DynFields.UnboundField<T> |
build()
Returns the first valid implementation as a UnboundField or throws a NoSuchFieldException if
there is none.
|
<T> DynFields.BoundField<T> |
build(Object target)
Returns the first valid implementation as a BoundMethod or throws a RuntimeException if there
is none.
|
<T> DynFields.UnboundField<T> |
buildChecked()
Returns the first valid implementation as a UnboundField or throws a NoSuchFieldException if
there is none.
|
<T> DynFields.BoundField<T> |
buildChecked(Object target)
Returns the first valid implementation as a BoundMethod or throws a NoSuchMethodException if
there is none.
|
<T> DynFields.StaticField<T> |
buildStatic()
Returns the first valid implementation as a StaticField or throws a RuntimeException if there
is none.
|
<T> DynFields.StaticField<T> |
buildStaticChecked()
Returns the first valid implementation as a StaticField or throws a NoSuchFieldException if
there is none.
|
DynFields.Builder |
defaultAlwaysNull()
Instructs this builder to return AlwaysNull if no implementation is found.
|
DynFields.Builder |
hiddenImpl(Class<?> targetClass,
String fieldName)
Checks for a hidden implementation.
|
DynFields.Builder |
hiddenImpl(String className,
String fieldName)
Checks for a hidden implementation, first finding the class by name.
|
DynFields.Builder |
impl(Class<?> targetClass,
String fieldName)
Checks for an implementation.
|
DynFields.Builder |
impl(String className,
String fieldName)
Checks for an implementation, first finding the class by name.
|
DynFields.Builder |
loader(ClassLoader newLoader)
Set the
ClassLoader used to lookup classes by name. |
public DynFields.Builder loader(ClassLoader newLoader)
ClassLoader used to lookup classes by name.
If not set, the current thread's ClassLoader is used.
newLoader - a ClassLoaderpublic DynFields.Builder defaultAlwaysNull()
public DynFields.Builder impl(String className, String fieldName)
className - name of a classfieldName - name of the fieldClass.forName(String),
Class.getField(String)public DynFields.Builder impl(Class<?> targetClass, String fieldName)
targetClass - a class instancefieldName - name of a field (different from constructor)Class.forName(String),
Class.getField(String)public DynFields.Builder hiddenImpl(String className, String fieldName)
className - name of a classfieldName - name of a field (different from constructor)Class.forName(String),
Class.getField(String)public DynFields.Builder hiddenImpl(Class<?> targetClass, String fieldName)
targetClass - a class instancefieldName - name of a field (different from constructor)Class.forName(String),
Class.getField(String)public <T> DynFields.UnboundField<T> buildChecked() throws NoSuchFieldException
T - Java class stored in the fieldDynFields.UnboundField with a valid implementationNoSuchFieldException - if no implementation was foundpublic <T> DynFields.BoundField<T> buildChecked(Object target) throws NoSuchFieldException
T - Java class stored in the fieldtarget - an Object on which to get and set the fieldDynFields.BoundField with a valid implementation and targetIllegalStateException - if the method is staticIllegalArgumentException - if the receiver's class is incompatibleNoSuchFieldException - if no implementation was foundpublic <T> DynFields.UnboundField<T> build()
T - Java class stored in the fieldDynFields.UnboundField with a valid implementationRuntimeException - if no implementation was foundpublic <T> DynFields.BoundField<T> build(Object target)
T - Java class stored in the fieldtarget - an Object on which to get and set the fieldDynFields.BoundField with a valid implementation and targetIllegalStateException - if the method is staticIllegalArgumentException - if the receiver's class is incompatibleRuntimeException - if no implementation was foundpublic <T> DynFields.StaticField<T> buildStaticChecked() throws NoSuchFieldException
T - Java class stored in the fieldDynFields.StaticField with a valid implementationIllegalStateException - if the method is not staticNoSuchFieldException - if no implementation was foundpublic <T> DynFields.StaticField<T> buildStatic()
T - Java class stored in the fieldDynFields.StaticField with a valid implementationIllegalStateException - if the method is not staticRuntimeException - if no implementation was foundCopyright © 2023 The Apache Software Foundation. All rights reserved.