public static class DynMethods.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
DynMethods.UnboundMethod |
build()
Returns the first valid implementation as a UnboundMethod or throws a
RuntimeError if there is none.
|
DynMethods.BoundMethod |
build(Object receiver)
Returns the first valid implementation as a BoundMethod or throws a
RuntimeError if there is none.
|
DynMethods.UnboundMethod |
buildChecked()
Returns the first valid implementation as a UnboundMethod or throws a
NoSuchMethodException if there is none.
|
DynMethods.BoundMethod |
buildChecked(Object receiver)
Returns the first valid implementation as a BoundMethod or throws a
NoSuchMethodException if there is none.
|
DynMethods.StaticMethod |
buildStatic()
Returns the first valid implementation as a StaticMethod or throws a
RuntimeException if there is none.
|
DynMethods.StaticMethod |
buildStaticChecked()
Returns the first valid implementation as a StaticMethod or throws a
NoSuchMethodException if there is none.
|
DynMethods.Builder |
ctorImpl(Class<?> targetClass,
Class<?>... argClasses) |
DynMethods.Builder |
ctorImpl(String className,
Class<?>... argClasses) |
DynMethods.Builder |
hiddenImpl(Class<?> targetClass,
Class<?>... argClasses)
Checks for a method implementation.
|
DynMethods.Builder |
hiddenImpl(Class<?> targetClass,
String methodName,
Class<?>... argClasses)
Checks for a method implementation.
|
DynMethods.Builder |
hiddenImpl(String className,
Class<?>... argClasses)
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
hiddenImpl(String className,
String methodName,
Class<?>... argClasses)
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
impl(Class<?> targetClass,
Class<?>... argClasses)
Checks for a method implementation.
|
DynMethods.Builder |
impl(Class<?> targetClass,
String methodName,
Class<?>... argClasses)
Checks for a method implementation.
|
DynMethods.Builder |
impl(String className,
Class<?>... argClasses)
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
impl(String className,
String methodName,
Class<?>... argClasses)
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
loader(ClassLoader loader)
Set the
ClassLoader used to lookup classes by name. |
DynMethods.Builder |
orNoop()
If no implementation has been found, adds a NOOP method.
|
public Builder(String methodName)
public DynMethods.Builder loader(ClassLoader loader)
ClassLoader used to lookup classes by name.
If not set, the current thread's ClassLoader is used.
loader - a ClassLoaderpublic DynMethods.Builder orNoop()
public DynMethods.Builder impl(String className, String methodName, Class<?>... argClasses)
className - name of a classmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder impl(String className, Class<?>... argClasses)
className - name of a classargClasses - argument classes for the methodpublic DynMethods.Builder impl(Class<?> targetClass, String methodName, Class<?>... argClasses)
targetClass - the class to check for an implementationmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder impl(Class<?> targetClass, Class<?>... argClasses)
targetClass - the class to check for an implementationargClasses - argument classes for the methodpublic DynMethods.Builder ctorImpl(Class<?> targetClass, Class<?>... argClasses)
public DynMethods.Builder ctorImpl(String className, Class<?>... argClasses)
public DynMethods.Builder hiddenImpl(String className, String methodName, Class<?>... argClasses)
className - name of a classmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder hiddenImpl(String className, Class<?>... argClasses)
className - name of a classargClasses - argument classes for the methodpublic DynMethods.Builder hiddenImpl(Class<?> targetClass, String methodName, Class<?>... argClasses)
targetClass - the class to check for an implementationmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder hiddenImpl(Class<?> targetClass, Class<?>... argClasses)
targetClass - the class to check for an implementationargClasses - argument classes for the methodpublic DynMethods.UnboundMethod buildChecked() throws NoSuchMethodException
DynMethods.UnboundMethod with a valid implementationNoSuchMethodException - if no implementation was foundpublic DynMethods.UnboundMethod build()
DynMethods.UnboundMethod with a valid implementationRuntimeException - if no implementation was foundpublic DynMethods.BoundMethod buildChecked(Object receiver) throws NoSuchMethodException
receiver - an Object to receive the method invocationDynMethods.BoundMethod with a valid implementation and receiverIllegalStateException - if the method is staticIllegalArgumentException - if the receiver's class is incompatibleNoSuchMethodException - if no implementation was foundpublic DynMethods.BoundMethod build(Object receiver)
receiver - an Object to receive the method invocationDynMethods.BoundMethod with a valid implementation and receiverIllegalStateException - if the method is staticIllegalArgumentException - if the receiver's class is incompatibleRuntimeException - if no implementation was foundpublic DynMethods.StaticMethod buildStaticChecked() throws NoSuchMethodException
DynMethods.StaticMethod with a valid implementationIllegalStateException - if the method is not staticNoSuchMethodException - if no implementation was foundpublic DynMethods.StaticMethod buildStatic()
DynMethods.StaticMethod with a valid implementationIllegalStateException - if the method is not staticRuntimeException - if no implementation was foundCopyright © 2018 The Apache Software Foundation. All rights reserved.