public class MetaClassImpl extends java.lang.Object implements MetaClass, MutableMetaClass
MetaClass| Modifier and Type | Class and Description |
|---|---|
static class |
MetaClassImpl.Index |
static class |
MetaClassImpl.MetaConstructor
This is a helper class introduced in Groovy 2.1.0, which is used only by
indy.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object[] |
EMPTY_ARGUMENTS |
protected MetaMethod |
getPropertyMethod |
protected static java.lang.String |
INVOKE_METHOD_METHOD |
protected MetaMethod |
invokeMethodMethod |
protected boolean |
isGroovyObject |
protected boolean |
isMap |
protected MetaMethodIndex |
metaMethodIndex |
protected static java.lang.String |
METHOD_MISSING |
protected static java.lang.String |
PROPERTY_MISSING |
protected MetaClassRegistry |
registry |
protected MetaMethod |
setPropertyMethod |
protected static java.lang.String |
STATIC_METHOD_MISSING |
protected static java.lang.String |
STATIC_PROPERTY_MISSING |
protected CachedClass |
theCachedClass |
protected java.lang.Class |
theClass |
| Constructor and Description |
|---|
MetaClassImpl(java.lang.Class theClass)
Constructor that sets the methods to null
|
MetaClassImpl(java.lang.Class theClass,
MetaMethod[] add)
Constructor
|
MetaClassImpl(MetaClassRegistry registry,
java.lang.Class theClass)
Constructor with registry setting methods to null
|
MetaClassImpl(MetaClassRegistry registry,
java.lang.Class theClass,
MetaMethod[] add)
Constructor with registry
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMetaBeanProperty(MetaBeanProperty mp)
Adds a new MetaBeanProperty to this MetaClass
|
void |
addMetaMethod(MetaMethod method)
adds a MetaMethod to this class.
|
protected void |
addMetaMethodToIndex(MetaMethod method,
MetaMethodIndex.Header header) |
void |
addNewInstanceMethod(java.lang.reflect.Method method)
Adds an instance method to this metaclass.
|
void |
addNewStaticMethod(java.lang.reflect.Method method)
Adds a static method to this metaclass.
|
protected void |
applyPropertyDescriptors(java.beans.PropertyDescriptor[] propertyDescriptors) |
protected void |
checkIfGroovyObjectMethod(MetaMethod metaMethod)
Checks if the metaMethod is a method from the GroovyObject interface such as setProperty, getProperty and invokeMethod
|
protected void |
checkInitalised()
checks if the initialisation of the class id complete.
|
protected java.lang.Object |
chooseMethod(java.lang.String methodName,
java.lang.Object methodOrList,
java.lang.Class[] arguments)
Chooses the correct method to use from a list of methods which match by
name.
|
protected void |
clearInvocationCaches()
remove all method call cache entries.
|
CallSite |
createConstructorSite(CallSite site,
java.lang.Object[] args)
Create a CallSite
|
protected static java.lang.String |
createErrorMessageForAmbiguity(java.lang.String theClassName,
java.lang.String name,
java.lang.Class[] arguments,
java.util.LinkedList matches) |
CallSite |
createPogoCallCurrentSite(CallSite site,
java.lang.Class sender,
java.lang.Object[] args)
Create a CallSite
|
CallSite |
createPogoCallSite(CallSite site,
java.lang.Object[] args)
Create a CallSite
|
CallSite |
createPojoCallSite(CallSite site,
java.lang.Object receiver,
java.lang.Object[] args)
Create a CallSite
|
CallSite |
createStaticSite(CallSite site,
java.lang.Object[] args)
Create a CallSite
|
protected MetaMethod |
createTransformMetaMethod(MetaMethod method) |
protected static java.lang.Object |
doChooseMostSpecificParams(java.lang.String theClassName,
java.lang.String name,
java.util.List matchingMethods,
java.lang.Class[] arguments,
boolean checkParametersCompatible) |
protected void |
dropMethodCache(java.lang.String name) |
protected void |
dropStaticMethodCache(java.lang.String name) |
protected static MetaMethod |
findMethodInClassHierarchy(java.lang.Class instanceKlazz,
java.lang.String methodName,
java.lang.Class[] arguments,
MetaClass metaClass) |
protected MetaMethod |
findMixinMethod(java.lang.String methodName,
java.lang.Class[] arguments) |
protected static MetaMethod |
findOwnMethod(java.lang.Class instanceKlazz,
java.lang.String methodName,
java.lang.Class[] arguments,
MetaClass metaClass,
MetaMethod method) |
protected MetaBeanProperty |
findPropertyInClassHierarchy(java.lang.String propertyName,
CachedClass theClass) |
MetaMethod[] |
getAdditionalMetaMethods()
Retrieves a list of additional MetaMethods held by this class
|
java.lang.Object |
getAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
boolean useSuper)
Retrieves the value of an attribute (field).
|
java.lang.Object |
getAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
boolean useSuper,
boolean fromInsideClass)
Retrieves the value of an attribute (field).
|
java.lang.Object |
getAttribute(java.lang.Object object,
java.lang.String attribute)
Retrieves the value of an attribute (field).
|
ClassInfo |
getClassInfo()
Returns the ClassInfo for the contained Class
|
ClassNode |
getClassNode()
Obtains a reference to the original AST for the MetaClass if it is available at runtime
|
MetaProperty |
getEffectiveGetMetaProperty(java.lang.Class sender,
java.lang.Object object,
java.lang.String name,
boolean useSuper) |
MetaMethod |
getMetaMethod(java.lang.String name,
java.lang.Object[] argTypes)
Retrieves an instance MetaMethod for the given name and argument values, using the types of the
argument values to establish the chosen MetaMethod
|
java.util.List<MetaMethod> |
getMetaMethods()
Retrieves the list of MetaMethods held by this class.
|
MetaProperty |
getMetaProperty(java.lang.String name)
Returns a MetaProperty for the given name or null if it doesn't exist
|
java.util.List<MetaMethod> |
getMethods()
Retrieves the list of MetaMethods held by the class.
|
MetaMethod |
getMethodWithCaching(java.lang.Class sender,
java.lang.String methodName,
java.lang.Object[] arguments,
boolean isCallToSuper) |
MetaMethod |
getMethodWithoutCaching(java.lang.Class sender,
java.lang.String methodName,
java.lang.Class[] arguments,
boolean isCallToSuper) |
java.util.List<MetaProperty> |
getProperties()
Get all the properties defined for this type
|
java.lang.Object |
getProperty(java.lang.Class sender,
java.lang.Object object,
java.lang.String name,
boolean useSuper,
boolean fromInsideClass)
Retrieves a property on the given receiver for the specified arguments.
|
java.lang.Object |
getProperty(java.lang.Object object,
java.lang.String property)
Retrieves a property on the given object for the specified arguments.
|
MetaClassRegistry |
getRegistry()
Returns the registry for this metaclass
|
MetaMethod |
getStaticMetaMethod(java.lang.String name,
java.lang.Object[] argTypes)
Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments
to establish the chosen MetaMethod
|
protected java.lang.Object |
getSubclassMetaMethods(java.lang.String methodName) |
protected java.util.LinkedList<CachedClass> |
getSuperClasses() |
CachedClass |
getTheCachedClass()
Returns the cached class for this metaclass
|
java.lang.Class |
getTheClass()
Returns the class this object this is the metaclass of.
|
int |
getVersion()
Returns version of the contained Class
|
protected static long |
handleMatches(long matchesDistance,
java.util.LinkedList matches,
java.lang.Object method,
long dist) |
boolean |
hasCustomInvokeMethod()
indicates is the meta class method invocation for non-static methods is done
through a custom invoker object.
|
boolean |
hasCustomStaticInvokeMethod()
indicates is the meta class method invocation for static methods is done
through a custom invoker object.
|
MetaProperty |
hasProperty(java.lang.Object obj,
java.lang.String name)
Returns true of the implementing MetaClass has a property of the given name
|
void |
incVersion()
Increments version of the contained Class
|
void |
initialize()
Complete the initialisation process.
|
java.lang.Object |
invokeConstructor(java.lang.Object[] arguments)
Invokes a constructor for the given arguments.
|
java.lang.Object |
invokeMethod(java.lang.Class sender,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] originalArguments,
boolean isCallToSuper,
boolean fromInsideClass)
Invokes a method on the given receiver for the specified arguments.
|
java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object arguments)
Invoke a method on the given object with the given arguments.
|
java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] originalArguments)
Invokes a method on the given receiver for the specified arguments.
|
java.lang.Object |
invokeMissingMethod(java.lang.Object instance,
java.lang.String methodName,
java.lang.Object[] arguments)
Invoke a missing method on the given object with the given arguments.
|
java.lang.Object |
invokeMissingProperty(java.lang.Object instance,
java.lang.String propertyName,
java.lang.Object optionalValue,
boolean isGetter)
Invoke a missing property on the given object with the given arguments.
|
java.lang.Object |
invokeStaticMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments)
Invokes a static method on the given Object with the given name and arguments.
|
protected java.lang.Object |
invokeStaticMissingProperty(java.lang.Object instance,
java.lang.String propertyName,
java.lang.Object optionalValue,
boolean isGetter)
Hook to deal with the case of MissingProperty for static properties.
|
boolean |
isGroovyObject()
Return wether the class represented by this metaclass instance is an instance of the GroovyObject class
|
protected boolean |
isInitialized() |
boolean |
isModified()
Returns whether this MetaClassImpl has been modified.
|
protected void |
onGetPropertyFoundInHierarchy(MetaMethod method) |
protected void |
onInvokeMethodFoundInHierarchy(MetaMethod method) |
protected void |
onMixinMethodFound(MetaMethod method) |
protected void |
onSetPropertyFoundInHierarchy(MetaMethod method) |
protected void |
onSuperMethodFoundInHierarchy(MetaMethod method) |
protected void |
onSuperPropertyFoundInHierarchy(MetaBeanProperty property) |
MetaMethod |
pickMethod(java.lang.String methodName,
java.lang.Class[] arguments)
Selects a method by name and argument classes.
|
java.util.List |
respondsTo(java.lang.Object obj,
java.lang.String name)
Returns an object satisfying Groovy truth if the implementing MetaClass responds to
a method with the given name regardless of arguments.
|
java.util.List |
respondsTo(java.lang.Object obj,
java.lang.String name,
java.lang.Object[] argTypes)
Returns an object satisfying Groovy truth if the implementing MetaClass responds to
a method with the given name and arguments types.
|
java.lang.reflect.Constructor |
retrieveConstructor(java.lang.Class[] arguments) |
MetaMethod |
retrieveConstructor(java.lang.Object[] arguments)
This is a helper method added in Groovy 2.1.0, which is used only by indy.
|
MetaMethod |
retrieveStaticMethod(java.lang.String methodName,
java.lang.Object[] arguments) |
int |
selectConstructorAndTransformArguments(int numberOfConstructors,
java.lang.Object[] arguments)
Internal method to support Groovy runtime.
|
void |
setAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
java.lang.Object newValue,
boolean useSuper,
boolean fromInsideClass)
Sets an attribute on the given receiver for the specified arguments.
|
void |
setAttribute(java.lang.Object object,
java.lang.String attribute,
java.lang.Object newValue)
Sets the value of an attribute (field).
|
void |
setProperties(java.lang.Object bean,
java.util.Map map)
Sets a number of bean properties from the given Map where the keys are
the String names of properties and the values are the values of the
properties to set
|
void |
setProperty(java.lang.Class sender,
java.lang.Object object,
java.lang.String name,
java.lang.Object newValue,
boolean useSuper,
boolean fromInsideClass)
Retrieves a property on the given receiver for the specified arguments.
|
void |
setProperty(java.lang.Object object,
java.lang.String property,
java.lang.Object newValue)
Sets a property on the given object for the specified arguments.
|
java.lang.String |
toString()
Returns a string representation of this metaclass
|
protected static final java.lang.String STATIC_METHOD_MISSING
protected static final java.lang.String STATIC_PROPERTY_MISSING
protected static final java.lang.String METHOD_MISSING
protected static final java.lang.String PROPERTY_MISSING
protected static final java.lang.String INVOKE_METHOD_METHOD
protected final java.lang.Class theClass
protected final CachedClass theCachedClass
protected MetaMethod getPropertyMethod
protected MetaMethod invokeMethodMethod
protected MetaMethod setPropertyMethod
protected MetaClassRegistry registry
protected final boolean isGroovyObject
protected final boolean isMap
public static final java.lang.Object[] EMPTY_ARGUMENTS
protected final MetaMethodIndex metaMethodIndex
public MetaClassImpl(java.lang.Class theClass,
MetaMethod[] add)
theClass - The class this is the metaclass doradd - The methods for this classpublic MetaClassImpl(java.lang.Class theClass)
theClass - The class this is the metaclass dorpublic MetaClassImpl(MetaClassRegistry registry, java.lang.Class theClass, MetaMethod[] add)
registry - The metaclass registry for this MetaClasstheClass - The classadd - The methodspublic MetaClassImpl(MetaClassRegistry registry, java.lang.Class theClass)
registry - The metaclass registry for this MetaClasstheClass - The classpublic final CachedClass getTheCachedClass()
public MetaClassRegistry getRegistry()
public java.util.List respondsTo(java.lang.Object obj,
java.lang.String name,
java.lang.Object[] argTypes)
MetaObjectProtocolReturns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.
Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing
This method is "safe" in that it will always return a value and never throw an exception
respondsTo in interface MetaObjectProtocolobj - The object to inspectname - The name of the method of interestargTypes - The argument types to match againstMetaObjectProtocol.respondsTo(Object, String, Object[])public java.util.List respondsTo(java.lang.Object obj,
java.lang.String name)
MetaObjectProtocolReturns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments. In other words this method will return for foo() and foo(String).
Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing
This method is "safe" in that it will always return a value and never throw an exception
respondsTo in interface MetaObjectProtocolobj - The object to inspectname - The name of the method of interestMetaObjectProtocol.respondsTo(Object, String)public MetaProperty hasProperty(java.lang.Object obj, java.lang.String name)
MetaObjectProtocolReturns true of the implementing MetaClass has a property of the given name
Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing
hasProperty in interface MetaObjectProtocolobj - The object to inspectname - The name of the propertyMetaObjectProtocol.hasProperty(Object,String)public MetaProperty getMetaProperty(java.lang.String name)
MetaObjectProtocolgetMetaProperty in interface MetaObjectProtocolname - The name of the MetaPropertyMetaObjectProtocol.getMetaProperty(String)public MetaMethod getStaticMetaMethod(java.lang.String name, java.lang.Object[] argTypes)
MetaObjectProtocolgetStaticMetaMethod in interface MetaObjectProtocolname - The name of the MetaMethodargTypes - The argument typesMetaObjectProtocol.getStaticMetaMethod(String, Object[])public MetaMethod getMetaMethod(java.lang.String name, java.lang.Object[] argTypes)
MetaObjectProtocolgetMetaMethod in interface MetaObjectProtocolname - The name of the MetaMethodargTypes - Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument typesMetaObjectProtocol.getMetaMethod(String, Object[])public java.lang.Class getTheClass()
getTheClass in interface MetaObjectProtocolpublic boolean isGroovyObject()
protected java.util.LinkedList<CachedClass> getSuperClasses()
public boolean isModified()
isModified in interface MutableMetaClasspublic void addNewInstanceMethod(java.lang.reflect.Method method)
addNewInstanceMethod in interface MutableMetaClassmethod - The method to be addedpublic void addNewStaticMethod(java.lang.reflect.Method method)
addNewStaticMethod in interface MutableMetaClassmethod - The method to be addedpublic java.lang.Object invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object arguments)
invokeMethod in interface MetaObjectProtocolobject - The object the method should be invoked on.methodName - The name of the method to invoke.arguments - The arguments to the invoked method as null, a Tuple, an array or a single argument of any type.MetaObjectProtocol.invokeMethod(Object, String, Object[])public java.lang.Object invokeMissingMethod(java.lang.Object instance,
java.lang.String methodName,
java.lang.Object[] arguments)
invokeMissingMethod in interface MetaClassinstance - The object the method should be invoked on.methodName - The name of the method to invoke.arguments - The arguments to the invoked method.MissingMethodExceptionpublic java.lang.Object invokeMissingProperty(java.lang.Object instance,
java.lang.String propertyName,
java.lang.Object optionalValue,
boolean isGetter)
invokeMissingProperty in interface MetaClassinstance - The object the method should be invoked on.propertyName - The name of the property to invoke.optionalValue - The (optional) new value for the propertyisGetter - Wether the method is a getterprotected void onSuperPropertyFoundInHierarchy(MetaBeanProperty property)
protected void onMixinMethodFound(MetaMethod method)
protected void onSuperMethodFoundInHierarchy(MetaMethod method)
protected void onInvokeMethodFoundInHierarchy(MetaMethod method)
protected void onSetPropertyFoundInHierarchy(MetaMethod method)
protected void onGetPropertyFoundInHierarchy(MetaMethod method)
protected java.lang.Object invokeStaticMissingProperty(java.lang.Object instance,
java.lang.String propertyName,
java.lang.Object optionalValue,
boolean isGetter)
instance - The instancepropertyName - The name of the propertyoptionalValue - The value in the case of a setterisGetter - True if its a getterpublic java.lang.Object invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] originalArguments)
invokeMethod in interface MetaObjectProtocolobject - The object which the method was invoked onmethodName - The name of the methodoriginalArguments - The arguments to the methodMetaClass.invokeMethod(Class, Object, String, Object[], boolean, boolean)public java.lang.Object invokeMethod(java.lang.Class sender,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] originalArguments,
boolean isCallToSuper,
boolean fromInsideClass)
Invokes a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
invokeMethod in interface MetaClasssender - The java.lang.Class instance that invoked the methodobject - The object which the method was invoked onmethodName - The name of the methodoriginalArguments - The arguments to the methodisCallToSuper - Whether the method is a call to a super class methodfromInsideClass - Whether the call was invoked from the inside or the outside of the classMetaClass.invokeMethod(Class, Object, String, Object[], boolean, boolean)protected MetaMethod createTransformMetaMethod(MetaMethod method)
public MetaMethod getMethodWithCaching(java.lang.Class sender, java.lang.String methodName, java.lang.Object[] arguments, boolean isCallToSuper)
public java.lang.reflect.Constructor retrieveConstructor(java.lang.Class[] arguments)
public MetaMethod retrieveStaticMethod(java.lang.String methodName, java.lang.Object[] arguments)
public MetaMethod getMethodWithoutCaching(java.lang.Class sender, java.lang.String methodName, java.lang.Class[] arguments, boolean isCallToSuper)
public java.lang.Object invokeStaticMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments)
MetaObjectProtocolThe Object can either be an instance of the class that this MetaObjectProtocol instance applies to or the java.lang.Class instance itself. If a method cannot be invoked a MissingMethodException is will be thrown
invokeStaticMethod in interface MetaObjectProtocolobject - An instance of the class returned by the getTheClass() method or the class itselfmethodName - The name of the methodarguments - The arguments to the methodMissingMethodExceptionpublic java.lang.Object invokeConstructor(java.lang.Object[] arguments)
MetaObjectProtocolinvokeConstructor in interface MetaObjectProtocolarguments - The arguments to the constructorpublic int selectConstructorAndTransformArguments(int numberOfConstructors,
java.lang.Object[] arguments)
MetaClassselectConstructorAndTransformArguments in interface MetaClassnumberOfConstructors - The number of constructorsarguments - The argumentsprotected void checkInitalised()
java.lang.IllegalStateException - if the initialisation is incomplete yetpublic MetaMethod retrieveConstructor(java.lang.Object[] arguments)
public void setProperties(java.lang.Object bean,
java.util.Map map)
public java.lang.Object getProperty(java.lang.Class sender,
java.lang.Object object,
java.lang.String name,
boolean useSuper,
boolean fromInsideClass)
MetaClassRetrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
getProperty in interface MetaClasssender - The java.lang.Class instance that requested the propertyobject - The Object which the property is being retrieved fromname - The name of the propertyuseSuper - Whether the call is to a super class propertyfromInsideClass - ??public MetaProperty getEffectiveGetMetaProperty(java.lang.Class sender, java.lang.Object object, java.lang.String name, boolean useSuper)
public java.util.List<MetaProperty> getProperties()
getProperties in interface MetaClassgetProperties in interface MetaObjectProtocolMetaPropertyprotected void applyPropertyDescriptors(java.beans.PropertyDescriptor[] propertyDescriptors)
public void addMetaBeanProperty(MetaBeanProperty mp)
addMetaBeanProperty in interface MutableMetaClassmp - The MetaBeanPropertypublic void setProperty(java.lang.Class sender,
java.lang.Object object,
java.lang.String name,
java.lang.Object newValue,
boolean useSuper,
boolean fromInsideClass)
Retrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The useSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
setProperty in interface MetaClasssender - The java.lang.Class instance that is mutating the propertyobject - The Object which the property is being set onname - The name of the propertynewValue - The new value of the property to setuseSuper - Whether the call is to a super class propertyfromInsideClass - Whether the call was invoked from the inside or the outside of the class.public java.lang.Object getAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
boolean useSuper)
getAttribute in interface MetaClasssender - The class of the object that requested the attributeobject - The instanceattribute - The name of the attributeuseSuper - Whether to look-up on the super class or notpublic java.lang.Object getAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
boolean useSuper,
boolean fromInsideClass)
sender - The class of the object that requested the attributeobject - The instance the attribute is to be retrieved fromattribute - The name of the attributeuseSuper - Whether to look-up on the super class or notfromInsideClass - Whether the call was invoked from the inside or the outside of the class.public void setAttribute(java.lang.Class sender,
java.lang.Object object,
java.lang.String attribute,
java.lang.Object newValue,
boolean useSuper,
boolean fromInsideClass)
Sets an attribute on the given receiver for the specified arguments. The sender is the class that is setting the attribute from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
setAttribute in interface MetaClasssender - The java.lang.Class instance that is mutating the propertyobject - The Object which the property is being set onattribute - The name of the attribute,newValue - The new value of the attribute to setuseSuper - Whether the call is to a super class propertyfromInsideClass - Whether the call was invoked from the inside or the outside of the classpublic ClassNode getClassNode()
getClassNode in interface MetaClasspublic java.lang.String toString()
toString in class java.lang.Objectpublic void addMetaMethod(MetaMethod method)
addMetaMethod in interface MutableMetaClassmethod - the MetaMethodinitialize()protected void addMetaMethodToIndex(MetaMethod method, MetaMethodIndex.Header header)
protected final void checkIfGroovyObjectMethod(MetaMethod metaMethod)
metaMethod - The metaMethod instanceGroovyObjectprotected boolean isInitialized()
protected java.lang.Object chooseMethod(java.lang.String methodName,
java.lang.Object methodOrList,
java.lang.Class[] arguments)
methodOrList - the possible methods to choose fromarguments - protected static java.lang.Object doChooseMostSpecificParams(java.lang.String theClassName,
java.lang.String name,
java.util.List matchingMethods,
java.lang.Class[] arguments,
boolean checkParametersCompatible)
protected static java.lang.String createErrorMessageForAmbiguity(java.lang.String theClassName,
java.lang.String name,
java.lang.Class[] arguments,
java.util.LinkedList matches)
protected static long handleMatches(long matchesDistance,
java.util.LinkedList matches,
java.lang.Object method,
long dist)
public void initialize()
initialize in interface MetaClasspublic java.util.List<MetaMethod> getMethods()
getMethods in interface MetaClassgetMethods in interface MetaObjectProtocolMetaMethodpublic java.util.List<MetaMethod> getMetaMethods()
getMetaMethods in interface MetaClassprotected void dropStaticMethodCache(java.lang.String name)
protected void dropMethodCache(java.lang.String name)
public CallSite createPojoCallSite(CallSite site, java.lang.Object receiver, java.lang.Object[] args)
public CallSite createStaticSite(CallSite site, java.lang.Object[] args)
public CallSite createPogoCallSite(CallSite site, java.lang.Object[] args)
public CallSite createPogoCallCurrentSite(CallSite site, java.lang.Class sender, java.lang.Object[] args)
public CallSite createConstructorSite(CallSite site, java.lang.Object[] args)
public ClassInfo getClassInfo()
public int getVersion()
public void incVersion()
public MetaMethod[] getAdditionalMetaMethods()
protected MetaBeanProperty findPropertyInClassHierarchy(java.lang.String propertyName, CachedClass theClass)
protected MetaMethod findMixinMethod(java.lang.String methodName, java.lang.Class[] arguments)
protected static MetaMethod findMethodInClassHierarchy(java.lang.Class instanceKlazz, java.lang.String methodName, java.lang.Class[] arguments, MetaClass metaClass)
protected static MetaMethod findOwnMethod(java.lang.Class instanceKlazz, java.lang.String methodName, java.lang.Class[] arguments, MetaClass metaClass, MetaMethod method)
protected java.lang.Object getSubclassMetaMethods(java.lang.String methodName)
public java.lang.Object getProperty(java.lang.Object object,
java.lang.String property)
Retrieves a property on the given object for the specified arguments.
getProperty in interface MetaObjectProtocolobject - The Object which the property is being retrieved fromproperty - The name of the propertyMetaClassImplpublic void setProperty(java.lang.Object object,
java.lang.String property,
java.lang.Object newValue)
Sets a property on the given object for the specified arguments.
setProperty in interface MetaObjectProtocolobject - The Object which the property is being retrieved fromproperty - The name of the propertynewValue - The new valueMetaClassImplpublic java.lang.Object getAttribute(java.lang.Object object,
java.lang.String attribute)
getAttribute in interface MetaObjectProtocolobject - The object to get the attribute fromattribute - The name of the attributeMetaClassImplpublic void setAttribute(java.lang.Object object,
java.lang.String attribute,
java.lang.Object newValue)
setAttribute in interface MetaObjectProtocolobject - The object to get the attribute fromattribute - The name of the attributenewValue - The new value of the attributeMetaClassImplpublic MetaMethod pickMethod(java.lang.String methodName, java.lang.Class[] arguments)
pickMethod in interface MetaClassmethodName - the name of the method to pickarguments - the method argumentsGroovyRuntimeException - if there is more than one matching methodpublic boolean hasCustomInvokeMethod()
public boolean hasCustomStaticInvokeMethod()
protected void clearInvocationCaches()