Package groovy.lang
Class MetaMethod
java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
- All Implemented Interfaces:
- MetaMember,- Cloneable
- Direct Known Subclasses:
- CachedMethod,- CallSiteAwareMetaMethod,- ClosureMetaMethod,- ClosureStaticMetaMethod,- GeneratedMetaMethod,- MetaClassImpl.MetaConstructor,- MixinInstanceMetaMethod,- ReflectionMetaMethod,- TransformMetaMethod
Represents a Method on a Java object a little like 
Method
 except without using reflection to invoke the method- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for a metamethod with an empty parameter list.MetaMethod(Class[] pt) Constructor with a list of parameter classes.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcheckParameters(Class[] arguments) Deprecated.clone()doMethodInvoke(Object object, Object[] arguments) Invokes the method this object represents.protected static booleanequal(CachedClass[] a, Class[] b) protected static booleanequal(CachedClass[] a, CachedClass[] b) abstract CachedClassGets the class where this method is declared.Returns a descriptor of this method based on the return type and parameters of this method.abstract intReturns the modifiers of this method.abstract StringgetName()Returns the name of this method.abstract ClassReturns the return type for this method.Returns the signature of this method.abstract ObjectInvokes this method.booleanReturns whether this method is abstract.booleanReturns whether this object is cacheable.booleanReturns whether this method is interface-default.booleanisMethod(MetaMethod method) Returns true if this metamethod represents the same method as the argument.final booleanisSame(MetaMethod method) Determines if the given method has the same name, parameters, return type and modifiers but may be defined on another type.final RuntimeExceptionprocessDoMethodInvokeException(Exception e, Object object, Object[] arguments) Called when an exception occurs while invoking this method.toString()Methods inherited from class org.codehaus.groovy.reflection.ParameterTypescoerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, getPT, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypesMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface groovy.lang.MetaMemberisFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic
- 
Field Details- 
EMPTY_ARRAY
 
- 
- 
Constructor Details- 
MetaMethodpublic MetaMethod()Constructor for a metamethod with an empty parameter list.
- 
MetaMethodConstructor with a list of parameter classes.- Parameters:
- pt- A list of parameters types
 
 
- 
- 
Method Details- 
getModifierspublic abstract int getModifiers()Returns the modifiers of this method.- Specified by:
- getModifiersin interface- MetaMember
- Returns:
- modifiers as an int.
 
- 
getNameReturns the name of this method.- Specified by:
- getNamein interface- MetaMember
- Returns:
- name of this method
 
- 
getReturnTypeReturns the return type for this method.- Returns:
- the return type of this method
 
- 
getDeclaringClassGets the class where this method is declared.- Returns:
- class of this method
 
- 
checkParametersDeprecated.Checks that the given parameters are valid to call this method.- Parameters:
- arguments- the arguments to check
- Throws:
- IllegalArgumentException- if the parameters are not valid
 
- 
isMethodReturns true if this metamethod represents the same method as the argument.- Parameters:
- method- A metaMethod instance
- Returns:
- true if method is for the same method as this method, false otherwise.
 
- 
equal
- 
equal
- 
toString
- 
clone
- 
isAbstractpublic boolean isAbstract()Returns whether this method is abstract.- Returns:
- true if this method is abstract
 
- 
isDefaultpublic boolean isDefault()Returns whether this method is interface-default.- Returns:
- true if this method is default
 
- 
isSameDetermines if the given method has the same name, parameters, return type and modifiers but may be defined on another type.- Parameters:
- method- the method to compare against
 
- 
isCacheablepublic boolean isCacheable()Returns whether this object is cacheable.
- 
getDescriptorReturns a descriptor of this method based on the return type and parameters of this method.
- 
getSignatureReturns the signature of this method.- Returns:
- The signature of this method
 
- 
getMopName
- 
invokeInvokes this method.- Parameters:
- object- The object this method should be invoked on
- arguments- The arguments for the method if applicable
- Returns:
- The return value of the invocation
 
- 
doMethodInvokeInvokes the method this object represents.This method is not final but it should be overloaded very carefully and only by generated methods there is no guarantee that it will be called. - Parameters:
- object- The object the method is to be called at.
- arguments- Arguments for the method invocation.
- Returns:
- The return value of the invoked method.
 
- 
processDoMethodInvokeExceptionpublic final RuntimeException processDoMethodInvokeException(Exception e, Object object, Object[] arguments) Called when an exception occurs while invoking this method.
 
-