public abstract class MetaMethod extends ParameterTypes implements Cloneable
Method
except without using reflection to invoke the methodisVargsMethod, nativeParamTypes, parameterTypes
Constructor and Description |
---|
MetaMethod()
Constructor for a metamethod with an empty parameter list
|
MetaMethod(Class[] pt)
Constructor wit a list of parameter classes
|
Modifier and Type | Method and Description |
---|---|
void |
checkParameters(Class[] arguments)
Checks that the given parameters are valid to call this method
|
Object |
clone() |
Object |
doMethodInvoke(Object object,
Object[] argumentArray)
Invokes the method this object represents.
|
protected static boolean |
equal(CachedClass[] a,
CachedClass[] b) |
protected static boolean |
equal(CachedClass[] a,
Class[] b) |
abstract CachedClass |
getDeclaringClass()
Gets the class where this method is declared
|
String |
getDescriptor()
Return a descriptor of this method based on the return type and parameters of this method.
|
abstract int |
getModifiers()
Returns the modifiers for this method
|
String |
getMopName() |
abstract String |
getName()
Returns the name of the method represented by this class
|
abstract Class |
getReturnType()
Access the return type for this method
|
String |
getSignature()
Returns the signature of this method
|
abstract Object |
invoke(Object object,
Object[] arguments)
Invoke this method
|
boolean |
isAbstract()
Returns whether or not this method is abstract.
|
boolean |
isCacheable()
Returns whether this object is cacheable
|
boolean |
isMethod(MetaMethod method)
Returns true if this this metamethod represents the same method as the argument.
|
boolean |
isPrivate()
Returns whether or not this method is private.
|
boolean |
isProtected()
Returns whether or not this method is protected.
|
boolean |
isPublic()
Returns whether or not this method is public.
|
boolean |
isSame(MetaMethod method) |
boolean |
isStatic()
Returns whether or not this method is static.
|
RuntimeException |
processDoMethodInvokeException(Exception e,
Object object,
Object[] argumentArray)
This method is called when an exception occurs while invoking this method.
|
String |
toString()
Returns a string representation of this method
|
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, getPT, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypes
public MetaMethod()
public MetaMethod(Class[] pt)
pt
- A list of parameters typespublic abstract int getModifiers()
public abstract String getName()
public abstract Class getReturnType()
public abstract CachedClass getDeclaringClass()
public abstract Object invoke(Object object, Object[] arguments)
object
- The object this method should be invoked onarguments
- The arguments for the method if applicablepublic void checkParameters(Class[] arguments)
arguments
- the arguments to checkIllegalArgumentException
- if the parameters are not validpublic boolean isMethod(MetaMethod method)
method
- A metaMethod instanceprotected static boolean equal(CachedClass[] a, Class[] b)
protected static boolean equal(CachedClass[] a, CachedClass[] b)
public String toString()
public boolean isStatic()
public boolean isAbstract()
public final boolean isPrivate()
public final boolean isProtected()
public final boolean isPublic()
public final boolean isSame(MetaMethod method)
method
- the method to compare againstpublic boolean isCacheable()
public String getDescriptor()
public String getSignature()
public String getMopName()
public final RuntimeException processDoMethodInvokeException(Exception e, Object object, Object[] argumentArray)
public Object doMethodInvoke(Object object, Object[] argumentArray)
object
- The object the method is to be called at.argumentArray
- Arguments for the method invocation.