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