T
- The type@Internal public abstract class AbstractExecutableMethodsDefinition<T> extends Object implements ExecutableMethodsDefinition<T>, EnvironmentConfigurable
ExecutableMethodsDefinition
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractExecutableMethodsDefinition.MethodReference
Internal class representing method's metadata.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractExecutableMethodsDefinition(AbstractExecutableMethodsDefinition.MethodReference[] methodsReferences) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Environment environment)
Configure the component for the given environment.
|
protected Object |
dispatch(int index,
T target,
Object[] args)
Triggers the invocation of the method at index.
|
<R> Optional<ExecutableMethod<T,R>> |
findMethod(String name,
Class<?>... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
<R> Stream<ExecutableMethod<T,R>> |
findPossibleMethods(String name)
Finds possible methods for the given method name.
|
protected Method |
getAccessibleTargetMethodByIndex(int index)
Find
Method representation at the method by index. |
<R> ExecutableMethod<T,R> |
getExecutableMethodByIndex(int index)
Gets
ExecutableMethod method by it's index. |
Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
protected <R> ExecutableMethod<T,R> |
getMethod(String name,
Class<?>... argumentTypes)
Finds executable method or returns a null otherwise.
|
protected abstract Method |
getTargetMethodByIndex(int index)
Find
Method representation at the method by index. |
protected boolean |
methodAtIndexMatches(int index,
String name,
Class[] argumentTypes)
Checks if the method at index matches name and argument types.
|
protected RuntimeException |
unknownDispatchAtIndexException(int index)
Creates a new exception when the dispatch at index is not found.
|
protected Throwable |
unknownMethodAtIndexException(int index)
Creates a new exception when the method at index is not found.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasPropertyExpressions
protected AbstractExecutableMethodsDefinition(AbstractExecutableMethodsDefinition.MethodReference[] methodsReferences)
public void configure(Environment environment)
EnvironmentConfigurable
configure
in interface EnvironmentConfigurable
environment
- The environmentpublic Collection<ExecutableMethod<T,?>> getExecutableMethods()
getExecutableMethods
in interface ExecutableMethodsDefinition<T>
ExecutableMethod
instances for this definitionpublic <R> Optional<ExecutableMethod<T,R>> findMethod(String name, Class<?>... argumentTypes)
ExecutableMethodsDefinition
ExecutableMethod
for the given name and argument types.findMethod
in interface ExecutableMethodsDefinition<T>
R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
public <R> Stream<ExecutableMethod<T,R>> findPossibleMethods(String name)
ExecutableMethodsDefinition
findPossibleMethods
in interface ExecutableMethodsDefinition<T>
R
- The return typename
- The method namepublic <R> ExecutableMethod<T,R> getExecutableMethodByIndex(int index)
ExecutableMethod
method by it's index.R
- The result typeindex
- The method indexExecutableMethod
@Nullable protected <R> ExecutableMethod<T,R> getMethod(String name, Class<?>... argumentTypes)
R
- The return typename
- The method nameargumentTypes
- The method argumentsExecutableMethod
protected Object dispatch(int index, T target, Object[] args)
Executable.invoke(Object, Object...)
.index
- The method indextarget
- The targetargs
- The argumentsprotected abstract Method getTargetMethodByIndex(int index)
Method
representation at the method by index. Used by MethodReference.getTargetMethod()
.index
- The indexprotected final Method getAccessibleTargetMethodByIndex(int index)
Method
representation at the method by index. Used by MethodReference.getTargetMethod()
.index
- The indexprotected final Throwable unknownMethodAtIndexException(int index)
index
- The method indexprotected final RuntimeException unknownDispatchAtIndexException(int index)
index
- The method index