public abstract class Invocable
extends java.lang.Object
implements java.lang.reflect.Member
| Modifier and Type | Field and Description |
|---|---|
protected int |
lastParameterIndex |
protected java.util.List<java.lang.Object> |
parameters |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
coerceToType(java.lang.Object param,
java.lang.Class<?> type)
Coerce parameter values to parameter type and unwrap primitives.
|
bsh.Invocable.ParameterType |
collectParamaters(java.lang.Object base,
java.lang.Object[] params)
Basic parameter collection with pulling inherited cascade chaining.
|
protected bsh.Invocable.ParameterType |
collectParamaters(java.lang.Object base,
java.lang.Object[] params,
boolean fixedArity)
Collect using the invocation mode selected from the argument types.
|
boolean |
equals(java.lang.Object o) |
static Invocable |
get(java.lang.reflect.Constructor<?> c)
Public invocable class method for making constructor invocables.
|
static bsh.FieldAccess |
get(java.lang.reflect.Field f)
Public invocable class method for making field access invocables.
|
static Invocable |
get(java.lang.reflect.Method m)
Public invocable class method for making method invocables.
|
java.lang.Class<?> |
getDeclaringClass()
provides default constructs for an invocable member prototype.
|
protected int |
getLastParameterIndex()
provides default constructs for an invocable member prototype.
|
java.lang.String |
getMethodDescriptor()
Retrieve a bytecode descriptor representation of the method.
|
java.lang.invoke.MethodHandle |
getMethodHandle()
Enables lazy initialize of MethodHandle lookup only once with reuse.
|
int |
getModifiers()
provides default constructs for an invocable member prototype.
|
java.lang.String |
getName()
provides default constructs for an invocable member prototype.
|
java.lang.String[] |
getParamTypeDescriptors()
Retrieve a bytecode descriptor representation of the parameter types.
|
java.lang.String |
getReturnTypeDescriptor()
Retrieve a bytecode descriptor representation of the return type.
|
java.lang.Class<?> |
getVarArgsComponentType()
provides default constructs for an invocable member prototype.
|
java.lang.Class<?> |
getVarArgsType()
provides default constructs for an invocable member prototype.
|
int |
hashCode() |
java.lang.Object |
invoke(java.lang.Object base,
java.lang.Object... pars)
Abstraction to cleanly apply the primitive result wrapping.
|
boolean |
isGetter()
provides default constructs for an invocable member prototype.
|
boolean |
isInnerClass()
provides default constructs for an invocable member prototype.
|
boolean |
isSetter()
provides default constructs for an invocable member prototype.
|
boolean |
isStatic()
provides default constructs for an invocable member prototype.
|
boolean |
isSynthetic()
provides default constructs for an invocable member prototype.
|
boolean |
isVarArgs()
provides default constructs for an invocable member prototype.
|
java.lang.invoke.MethodType |
methodType()
Retrieve a method type from return type a parameter type signatures.
|
java.lang.String |
toString() |
protected final java.util.List<java.lang.Object> parameters
protected int lastParameterIndex
public static Invocable get(java.lang.reflect.Method m)
m - reflect method memberpublic static Invocable get(java.lang.reflect.Constructor<?> c)
m - reflect constructor memberpublic static bsh.FieldAccess get(java.lang.reflect.Field f)
m - reflect field memberpublic boolean isInnerClass()
public boolean isVarArgs()
public java.lang.Class<?> getVarArgsType()
public java.lang.Class<?> getVarArgsComponentType()
public boolean isGetter()
public boolean isSetter()
public int getModifiers()
getModifiers in interface java.lang.reflect.Memberpublic boolean isStatic()
public boolean isSynthetic()
isSynthetic in interface java.lang.reflect.Memberprotected int getLastParameterIndex()
public java.lang.Class<?> getDeclaringClass()
getDeclaringClass in interface java.lang.reflect.Memberpublic java.lang.String getName()
getName in interface java.lang.reflect.Memberpublic java.lang.invoke.MethodHandle getMethodHandle()
public java.lang.invoke.MethodType methodType()
public java.lang.String getMethodDescriptor()
public java.lang.String[] getParamTypeDescriptors()
public java.lang.String getReturnTypeDescriptor()
public bsh.Invocable.ParameterType collectParamaters(java.lang.Object base,
java.lang.Object[] params)
throws java.lang.Throwable
java.lang.Throwableprotected bsh.Invocable.ParameterType collectParamaters(java.lang.Object base,
java.lang.Object[] params,
boolean fixedArity)
throws java.lang.Throwable
java.lang.Throwableprotected java.lang.Object coerceToType(java.lang.Object param,
java.lang.Class<?> type)
throws java.lang.Throwable
param - the parameter valuetype - the parameter typejava.lang.Throwable - on cast errorspublic java.lang.Object invoke(java.lang.Object base,
java.lang.Object... pars)
throws java.lang.reflect.InvocationTargetException
base - represents the base object instance.pars - parameter argumentsjava.lang.reflect.InvocationTargetException - wrapped target exceptionspublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object