Class TransformMetaMethod
java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.runtime.metaclass.TransformMetaMethod
- All Implemented Interfaces:
MetaMember,Cloneable
A MetaMethod implementation useful for implementing coercion based invocations.
This method wraps another metamethod and allows for argument transformation or
other custom handling during method invocation.
-
Field Summary
Fields inherited from class groovy.lang.MetaMethod
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionTransformMetaMethod(MetaMethod metaMethod) Constructs a new TransformMetaMethod. -
Method Summary
Modifier and TypeMethodDescriptiondoMethodInvoke(Object object, Object[] arguments) Invokes the wrapped metamethod without argument coercion.Returns the class that declares the wrapped metamethod.intReturns the modifiers of the wrapped metamethod.getName()Returns the name of the wrapped metamethod.Returns the return type of the wrapped metamethod.Invokes the wrapped metamethod on the given object with the specified arguments.Methods inherited from class groovy.lang.MetaMethod
checkParameters, clone, equal, equal, getDescriptor, getMopName, getSignature, isAbstract, isCacheable, isDefault, isMethod, isSame, processDoMethodInvokeException, toStringMethods inherited from class org.codehaus.groovy.reflection.ParameterTypes
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, getPT, 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
-
Constructor Details
-
TransformMetaMethod
Constructs a new TransformMetaMethod.- Parameters:
metaMethod- the metamethod to wrap
-
-
Method Details
-
getModifiers
public int getModifiers()Returns the modifiers of the wrapped metamethod.- Specified by:
getModifiersin interfaceMetaMember- Specified by:
getModifiersin classMetaMethod- Returns:
- the method modifiers
-
getName
Returns the name of the wrapped metamethod.- Specified by:
getNamein interfaceMetaMember- Specified by:
getNamein classMetaMethod- Returns:
- the method name
-
getReturnType
Returns the return type of the wrapped metamethod.- Specified by:
getReturnTypein classMetaMethod- Returns:
- the return type
-
getDeclaringClass
Returns the class that declares the wrapped metamethod.- Specified by:
getDeclaringClassin classMetaMethod- Returns:
- the declaring class
-
invoke
Invokes the wrapped metamethod 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
-
doMethodInvoke
Invokes the wrapped metamethod without argument coercion. This method skips the default argument coercion performed by the parent invoke method.- Overrides:
doMethodInvokein classMetaMethod- Parameters:
object- the object to invoke the method onarguments- the method arguments- Returns:
- the method return value
-