public static final class DynMethods.Builder
extends java.lang.Object
| Constructor | Description |
|---|---|
Builder(java.lang.String methodName) |
| Modifier and Type | Method | Description |
|---|---|---|
DynMethods.UnboundMethod |
build() |
Returns the first valid implementation as a UnboundMethod or throws a
RuntimeError if there is none.
|
DynMethods.BoundMethod |
build(java.lang.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(java.lang.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(java.lang.Class<?> targetClass,
java.lang.Class<?>... argClasses) |
|
DynMethods.Builder |
ctorImpl(java.lang.String className,
java.lang.Class<?>... argClasses) |
|
DynMethods.Builder |
hiddenImpl(java.lang.Class<?> targetClass,
java.lang.Class<?>... argClasses) |
Checks for a method implementation.
|
DynMethods.Builder |
hiddenImpl(java.lang.Class<?> targetClass,
java.lang.String methodName,
java.lang.Class<?>... argClasses) |
Checks for a method implementation.
|
DynMethods.Builder |
hiddenImpl(java.lang.String className,
java.lang.Class<?>... argClasses) |
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
hiddenImpl(java.lang.String className,
java.lang.String methodName,
java.lang.Class<?>... argClasses) |
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
impl(java.lang.Class<?> targetClass,
java.lang.Class<?>... argClasses) |
Checks for a method implementation.
|
DynMethods.Builder |
impl(java.lang.Class<?> targetClass,
java.lang.String methodName,
java.lang.Class<?>... argClasses) |
Checks for a method implementation.
|
DynMethods.Builder |
impl(java.lang.String className,
java.lang.Class<?>... argClasses) |
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
impl(java.lang.String className,
java.lang.String methodName,
java.lang.Class<?>... argClasses) |
Checks for an implementation, first finding the given class by name.
|
DynMethods.Builder |
loader(java.lang.ClassLoader classLoader) |
Set the
ClassLoader used to lookup classes by name. |
DynMethods.Builder |
orNoop() |
If no implementation has been found, adds a NOOP method.
|
public DynMethods.Builder loader(java.lang.ClassLoader classLoader)
ClassLoader used to lookup classes by name.
If not set, the current thread's ClassLoader is used.
classLoader - a ClassLoaderpublic DynMethods.Builder orNoop()
Note: calls to impl will not match after this method is called!
public DynMethods.Builder impl(java.lang.String className, java.lang.String methodName, java.lang.Class<?>... argClasses)
className - name of a classmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder impl(java.lang.String className, java.lang.Class<?>... argClasses)
The name passed to the constructor is the method name used.
className - name of a classargClasses - argument classes for the methodpublic DynMethods.Builder impl(java.lang.Class<?> targetClass, java.lang.String methodName, java.lang.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(java.lang.Class<?> targetClass, java.lang.Class<?>... argClasses)
The name passed to the constructor is the method name used.
targetClass - the class to check for an implementationargClasses - argument classes for the methodpublic DynMethods.Builder ctorImpl(java.lang.Class<?> targetClass, java.lang.Class<?>... argClasses)
public DynMethods.Builder ctorImpl(java.lang.String className, java.lang.Class<?>... argClasses)
public DynMethods.Builder hiddenImpl(java.lang.String className, java.lang.String methodName, java.lang.Class<?>... argClasses)
className - name of a classmethodName - name of a method (different from constructor)argClasses - argument classes for the methodpublic DynMethods.Builder hiddenImpl(java.lang.String className, java.lang.Class<?>... argClasses)
The name passed to the constructor is the method name used.
className - name of a classargClasses - argument classes for the methodpublic DynMethods.Builder hiddenImpl(java.lang.Class<?> targetClass, java.lang.String methodName, java.lang.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(java.lang.Class<?> targetClass, java.lang.Class<?>... argClasses)
The name passed to the constructor is the method name used.
targetClass - the class to check for an implementationargClasses - argument classes for the methodpublic DynMethods.UnboundMethod buildChecked() throws java.lang.NoSuchMethodException
DynMethods.UnboundMethod with a valid implementationjava.lang.NoSuchMethodException - if no implementation was foundpublic DynMethods.UnboundMethod build()
DynMethods.UnboundMethod with a valid implementationjava.lang.RuntimeException - if no implementation was foundpublic DynMethods.BoundMethod buildChecked(java.lang.Object receiver) throws java.lang.NoSuchMethodException
receiver - an Object to receive the method invocationDynMethods.BoundMethod with a valid implementation and receiverjava.lang.IllegalStateException - if the method is staticjava.lang.IllegalArgumentException - if the receiver's class is incompatiblejava.lang.NoSuchMethodException - if no implementation was foundpublic DynMethods.BoundMethod build(java.lang.Object receiver)
receiver - an Object to receive the method invocationDynMethods.BoundMethod with a valid implementation and receiverjava.lang.IllegalStateException - if the method is staticjava.lang.IllegalArgumentException - if the receiver's class is incompatiblejava.lang.RuntimeException - if no implementation was foundpublic DynMethods.StaticMethod buildStaticChecked() throws java.lang.NoSuchMethodException
DynMethods.StaticMethod with a valid implementationjava.lang.IllegalStateException - if the method is not staticjava.lang.NoSuchMethodException - if no implementation was foundpublic DynMethods.StaticMethod buildStatic()
DynMethods.StaticMethod with a valid implementationjava.lang.IllegalStateException - if the method is not staticjava.lang.RuntimeException - if no implementation was foundCopyright © 2008–2025 Apache Software Foundation. All rights reserved.