Package groovy.lang
Class MetaMethod
- java.lang.Object
-
- org.codehaus.groovy.reflection.ParameterTypes
-
- groovy.lang.MetaMethod
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
CachedMethod,CallSiteAwareMetaMethod,ClosureMetaMethod,ClosureStaticMetaMethod,GeneratedMetaMethod,MixinInstanceMetaMethod,ReflectionMetaMethod,TransformMetaMethod
public abstract class MetaMethod extends ParameterTypes implements java.lang.Cloneable
Represents a Method on a Java object a little likeMethodexcept without using reflection to invoke the method- Version:
- $Revision$
- Author:
- James Strachan, Alex Tkachman
-
-
Field Summary
-
Fields inherited from class org.codehaus.groovy.reflection.ParameterTypes
isVargsMethod, nativeParamTypes, parameterTypes
-
-
Constructor Summary
Constructors Constructor Description MetaMethod()MetaMethod(java.lang.Class[] pt)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckParameters(java.lang.Class[] arguments)Checks that the given parameters are valid to call this methodjava.lang.Objectclone()java.lang.ObjectdoMethodInvoke(java.lang.Object object, java.lang.Object[] argumentArray)protected static booleanequal(CachedClass[] a, java.lang.Class[] b)protected static booleanequal(CachedClass[] a, CachedClass[] b)abstract CachedClassgetDeclaringClass()java.lang.StringgetDescriptor()abstract intgetModifiers()java.lang.StringgetMopName()abstract java.lang.StringgetName()abstract java.lang.ClassgetReturnType()java.lang.StringgetSignature()abstract java.lang.Objectinvoke(java.lang.Object object, java.lang.Object[] arguments)booleanisAbstract()booleanisCacheable()booleanisMethod(MetaMethod method)booleanisPrivate()booleanisProtected()booleanisPublic()booleanisSame(MetaMethod method)booleanisStatic()java.lang.RuntimeExceptionprocessDoMethodInvokeException(java.lang.Exception e, java.lang.Object object, java.lang.Object[] argumentArray)java.lang.StringtoString()-
Methods inherited from class org.codehaus.groovy.reflection.ParameterTypes
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, getPT, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, setParametersTypes
-
-
-
-
Method Detail
-
getModifiers
public abstract int getModifiers()
-
getName
public abstract java.lang.String getName()
-
getReturnType
public abstract java.lang.Class getReturnType()
-
getDeclaringClass
public abstract CachedClass getDeclaringClass()
-
invoke
public abstract java.lang.Object invoke(java.lang.Object object, java.lang.Object[] arguments)
-
checkParameters
public void checkParameters(java.lang.Class[] arguments)
Checks that the given parameters are valid to call this method- Parameters:
arguments- the arguments to check- Throws:
java.lang.IllegalArgumentException- if the parameters are not valid
-
isMethod
public boolean isMethod(MetaMethod method)
-
equal
protected static boolean equal(CachedClass[] a, java.lang.Class[] b)
-
equal
protected static boolean equal(CachedClass[] a, CachedClass[] b)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
isStatic
public boolean isStatic()
-
isAbstract
public boolean isAbstract()
-
isPrivate
public final boolean isPrivate()
-
isProtected
public final boolean isProtected()
-
isPublic
public final boolean isPublic()
-
isSame
public final boolean isSame(MetaMethod method)
- Parameters:
method- the method to compare against- Returns:
- true if the given method has the same name, parameters, return type and modifiers but may be defined on another type
-
isCacheable
public boolean isCacheable()
-
getDescriptor
public java.lang.String getDescriptor()
-
getSignature
public java.lang.String getSignature()
-
getMopName
public java.lang.String getMopName()
-
processDoMethodInvokeException
public final java.lang.RuntimeException processDoMethodInvokeException(java.lang.Exception e, java.lang.Object object, java.lang.Object[] argumentArray)
-
doMethodInvoke
public java.lang.Object doMethodInvoke(java.lang.Object object, java.lang.Object[] argumentArray)
-
-