Class ReflectionMetaMethod
java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod
- All Implemented Interfaces:
MetaMember,Cloneable
- Direct Known Subclasses:
NewMetaMethod
A MetaMethod implementation that wraps a reflection-based method call.
This class provides access to a cached method and delegates method invocations
to the underlying cached method.
This implementation is for internal use by the Groovy runtime.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CachedMethodThe underlying cached method that this MetaMethod wrapsFields inherited from class groovy.lang.MetaMethod
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionReflectionMetaMethod(CachedMethod method) Constructs a new ReflectionMetaMethod. -
Method Summary
Modifier and TypeMethodDescriptionReturns the cached method wrapped by this MetaMethod.Returns the class that declares the wrapped cached method.intReturns the modifiers of the wrapped cached method.getName()Returns the name of the wrapped cached method.protected Class[]getPT()Protected method subclasses override to provide parameter types.Returns the return type of the wrapped cached method.Invokes the wrapped cached method on the given object with the specified arguments.toString()Returns a string representation of the wrapped cached method.Methods inherited from class groovy.lang.MetaMethod
checkParameters, clone, doMethodInvoke, equal, equal, getDescriptor, getMopName, getSignature, isAbstract, isCacheable, isDefault, isMethod, isSame, processDoMethodInvokeExceptionMethods inherited from class org.codehaus.groovy.reflection.ParameterTypes
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface groovy.lang.MetaMember
isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic
-
Field Details
-
method
The underlying cached method that this MetaMethod wraps
-
-
Constructor Details
-
ReflectionMetaMethod
Constructs a new ReflectionMetaMethod.- Parameters:
method- the cached method to wrap
-
-
Method Details
-
getModifiers
public int getModifiers()Returns the modifiers of the wrapped cached method.- Specified by:
getModifiersin interfaceMetaMember- Specified by:
getModifiersin classMetaMethod- Returns:
- the method modifiers
-
getName
Returns the name of the wrapped cached method.- Specified by:
getNamein interfaceMetaMember- Specified by:
getNamein classMetaMethod- Returns:
- the method name
-
getReturnType
Returns the return type of the wrapped cached method.- Specified by:
getReturnTypein classMetaMethod- Returns:
- the return type
-
getDeclaringClass
Returns the class that declares the wrapped cached method.- Specified by:
getDeclaringClassin classMetaMethod- Returns:
- the declaring class
-
invoke
Invokes the wrapped cached method on the given object with the specified arguments.- Specified by:
invokein classMetaMethod- Parameters:
object- the object to invoke the method onarguments- the method arguments- Returns:
- the method return value
-
toString
Returns a string representation of the wrapped cached method.- Overrides:
toStringin classMetaMethod- Returns:
- the string representation
-
getPT
Description copied from class:ParameterTypesProtected method subclasses override to provide parameter types. Default implementation throwsUnsupportedOperationException.- Overrides:
getPTin classParameterTypes- Returns:
- the native parameter class array
-
getCachedMethod
Returns the cached method wrapped by this MetaMethod.- Returns:
- the cached method
-