Package org.codehaus.groovy.reflection
Class CachedMethod
java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.reflection.CachedMethod
- All Implemented Interfaces:
Cloneable
,Comparable
public class CachedMethod extends MetaMethod implements Comparable
-
Field Summary
Fields Modifier and Type Field Description CachedClass
cachedClass
static CachedMethod[]
EMPTY_ARRAY
Fields inherited from class org.codehaus.groovy.reflection.ParameterTypes
isVargsMethod, nativeParamTypes, parameterTypes
-
Constructor Summary
Constructors Constructor Description CachedMethod(Method method)
CachedMethod(CachedClass clazz, Method method)
-
Method Summary
Modifier and Type Method Description boolean
canAccessLegally(Class<?> callerClass)
int
compareTo(Object o)
CallSite
createPogoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)
CallSite
createPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)
CallSite
createStaticMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)
boolean
equals(Object o)
static CachedMethod
find(Method method)
<T extends Annotation>
TgetAnnotation(Class<T> annotationClass)
Method
getCachedMethod()
CachedClass
getDeclaringClass()
Gets the class where this method is declaredString
getDescriptor()
Return a descriptor of this method based on the return type and parameters of this method.int
getModifiers()
Returns the modifiers for this methodString
getName()
Returns the name of the method represented by this classint
getParamsCount()
ParameterTypes
getParamTypes()
Class[]
getPT()
Class
getReturnType()
Access the return type for this methodString
getSignature()
Returns the signature of this methodCachedMethod
getTransformedMethod()
int
hashCode()
Object
invoke(Object object, Object[] arguments)
Invoke this methodboolean
isStatic()
Returns whether or not this method is static.boolean
isSynthetic()
Method
setAccessible()
void
setTransformedMethod(CachedMethod transformedMethod)
String
toString()
Returns a string representation of this methodMethods inherited from class groovy.lang.MetaMethod
checkParameters, clone, doMethodInvoke, equal, equal, getMopName, isAbstract, isCacheable, isMethod, isPrivate, isProtected, isPublic, isSame, processDoMethodInvokeException
Methods inherited from class org.codehaus.groovy.reflection.ParameterTypes
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypes
-
Field Details
-
EMPTY_ARRAY
-
cachedClass
-
-
Constructor Details
-
CachedMethod
-
CachedMethod
-
-
Method Details
-
find
-
getPT
- Overrides:
getPT
in classParameterTypes
-
getName
Description copied from class:MetaMethod
Returns the name of the method represented by this class- Specified by:
getName
in classMetaMethod
- Returns:
- name of this method
-
getDescriptor
Description copied from class:MetaMethod
Return a descriptor of this method based on the return type and parameters of this method.- Overrides:
getDescriptor
in classMetaMethod
-
getDeclaringClass
Description copied from class:MetaMethod
Gets the class where this method is declared- Specified by:
getDeclaringClass
in classMetaMethod
- Returns:
- class of this method
-
invoke
Description copied from class:MetaMethod
Invoke this method- Specified by:
invoke
in classMetaMethod
- Parameters:
object
- The object this method should be invoked onarguments
- The arguments for the method if applicable- Returns:
- The return value of the invocation
-
getParamTypes
-
getReturnType
Description copied from class:MetaMethod
Access the return type for this method- Specified by:
getReturnType
in classMetaMethod
- Returns:
- the return type of this method
-
getParamsCount
public int getParamsCount() -
getModifiers
public int getModifiers()Description copied from class:MetaMethod
Returns the modifiers for this method- Specified by:
getModifiers
in classMetaMethod
- Returns:
- modifiers as an int.
-
getSignature
Description copied from class:MetaMethod
Returns the signature of this method- Overrides:
getSignature
in classMetaMethod
- Returns:
- The signature of this method
-
setAccessible
-
isStatic
public boolean isStatic()Description copied from class:MetaMethod
Returns whether or not this method is static.- Overrides:
isStatic
in classMetaMethod
- Returns:
- true if this method is static
-
getTransformedMethod
-
setTransformedMethod
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
equals
-
hashCode
public int hashCode() -
toString
Description copied from class:MetaMethod
Returns a string representation of this method- Overrides:
toString
in classMetaMethod
-
createPogoMetaMethodSite
-
createPojoMetaMethodSite
-
createStaticMetaMethodSite
-
getAnnotation
-
isSynthetic
public boolean isSynthetic() -
getCachedMethod
-
canAccessLegally
-