Class OwnedMetaClass
- All Implemented Interfaces:
- GroovyObject,- MetaClass,- MetaObjectProtocol,- MutableMetaClass
- Direct Known Subclasses:
- MixedInMetaClass
- 
Field SummaryFields inherited from class groovy.lang.DelegatingMetaClassdelegate
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleangetAttribute(Class sender, Object receiver, String messageName, boolean useSuper) Retrieves the value of an attribute (field).getAttribute(Object object, String attribute) Retrieves an attribute of an instance of the class returned by the getTheClass() method.Obtains a reference to the original AST for the MetaClass if it is available at runtimegetMetaMethod(String name, Class[] argTypes) getMetaMethod(String name, Object[] args) Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethodRetrieves a list of MetaMethods held by this class.getMetaProperty(String name) Returns a MetaProperty for the given name or null if it doesn't existRetrieves a list of MetaMethods held by the class.protected abstract ObjectgetOwner()protected abstract MetaClassgetOwnerMetaClass(Object owner) Retrieves a list of MetaProperty instances that the MetaClass hasgetProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass) Retrieves a property on the given receiver for the specified arguments.getProperty(Object object, String property) Retrieves a property of an instance of the class returned by the getTheClass() method.getStaticMetaMethod(String name, Class[] argTypes) getStaticMetaMethod(String name, Object[] args) Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethodRetrieves that Java Class that the attached Meta behaviours apply tointhashCode()hasProperty(Object obj, String name) Returns true of the implementing MetaClass has a property of the given nameinvokeConstructor(Object[] arguments) Invokes a constructor for the given arguments.invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass) Invokes a method on the given receiver for the specified arguments.invokeMethod(Object object, String methodName, Object arguments) Invokes a method on the given object, with the given name and single argument.invokeMethod(Object object, String methodName, Object[] arguments) Invokes a method on the given Object with the given name and arguments.invokeMissingMethod(Object instance, String methodName, Object[] arguments) Attempts to invoke the methodMissing method otherwise throws a MissingMethodExceptioninvokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter) Invokes the propertyMissing method otherwise throws a MissingPropertyExceptioninvokeStaticMethod(Object object, String methodName, Object[] arguments) Invokes a static method on the given Object with the given name and arguments.booleanrespondsTo(Object obj, String name) Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments.respondsTo(Object obj, String name, Object[] argTypes) Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.intselectConstructorAndTransformArguments(int numberOfConstructors, Object[] arguments) Internal method to support Groovy runtime.voidsetAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass) Sets the value of an attribute (field).voidsetAttribute(Object object, String attribute, Object newValue) Sets an attribute of an instance of the class returned by the getTheClass() method.voidsetProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass) Sets a property on the given receiver for the specified arguments.voidsetProperty(Object object, String property, Object newValue) Sets a property of an instance of the class returned by the getTheClass() method.toString()Methods inherited from class groovy.lang.DelegatingMetaClassaddMetaBeanProperty, addMetaMethod, addNewInstanceMethod, addNewStaticMethod, getAdaptee, getMetaClass, getProperty, initialize, invokeMethod, isModified, pickMethod, setAdaptee, setMetaClass, setProperty
- 
Constructor Details- 
OwnedMetaClass
 
- 
- 
Method Details- 
getAttributeDescription copied from interface:MetaObjectProtocolRetrieves an attribute of an instance of the class returned by the getTheClass() method.What this means is largely down to the MetaClass implementation, however the default case would result in attempt to read a field of the instance. - Specified by:
- getAttributein interface- MetaObjectProtocol
- Overrides:
- getAttributein class- DelegatingMetaClass
- Parameters:
- object- An instance of the class returned by the getTheClass() method
- attribute- The name of the attribute to retrieve the value for
- Returns:
- The attribute value
- See Also:
 
- 
getOwner
- 
getClassNodeDescription copied from interface:MetaClassObtains a reference to the original AST for the MetaClass if it is available at runtime- Specified by:
- getClassNodein interface- MetaClass
- Overrides:
- getClassNodein class- DelegatingMetaClass
- Returns:
- The original AST or null if it cannot be returned
 
- 
getMetaMethodsDescription copied from interface:MetaClassRetrieves a list of MetaMethods held by this class. This list includes MetaMethods added by groovy.lang.ExpandoMetaClass.- Specified by:
- getMetaMethodsin interface- MetaClass
- Overrides:
- getMetaMethodsin class- DelegatingMetaClass
- Returns:
- A list of MetaMethods
 
- 
getMethodsDescription copied from interface:MetaClassRetrieves a list of MetaMethods held by the class. This list does not include MetaMethods added by groovy.lang.ExpandoMetaClass.- Specified by:
- getMethodsin interface- MetaClass
- Specified by:
- getMethodsin interface- MetaObjectProtocol
- Overrides:
- getMethodsin class- DelegatingMetaClass
- Returns:
- A list of MetaMethods
- See Also:
 
- 
respondsToDescription copied from interface: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 - Specified by:
- respondsToin interface- MetaObjectProtocol
- Overrides:
- respondsToin class- DelegatingMetaClass
- Parameters:
- obj- The object to inspect
- name- The name of the method of interest
- argTypes- The argument types to match against
- Returns:
- A List of MetaMethods matching the argument types which will be empty if no matching methods exist
 
- 
respondsToDescription copied from interface: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 - Specified by:
- respondsToin interface- MetaObjectProtocol
- Overrides:
- respondsToin class- DelegatingMetaClass
- Parameters:
- obj- The object to inspect
- name- The name of the method of interest
- Returns:
- A List of MetaMethods which will be empty if no methods with the given name exist
 
- 
hasPropertyDescription copied from interface: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 - Specified by:
- hasPropertyin interface- MetaObjectProtocol
- Overrides:
- hasPropertyin class- DelegatingMetaClass
- Parameters:
- obj- The object to inspect
- name- The name of the property
- Returns:
- The MetaProperty or null if it doesn't exist
 
- 
getPropertiesDescription copied from interface:MetaClassRetrieves a list of MetaProperty instances that the MetaClass has- Specified by:
- getPropertiesin interface- MetaClass
- Specified by:
- getPropertiesin interface- MetaObjectProtocol
- Overrides:
- getPropertiesin class- DelegatingMetaClass
- Returns:
- A list of MetaProperty instances
- See Also:
 
- 
getPropertyDescription copied from interface:MetaObjectProtocolRetrieves a property of an instance of the class returned by the getTheClass() method.What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean getter, or if no such getter exists a public field of the instance. - Specified by:
- getPropertyin interface- MetaObjectProtocol
- Overrides:
- getPropertyin class- DelegatingMetaClass
- Parameters:
- object- An instance of the class returned by the getTheClass() method
- property- The name of the property to retrieve the value for
- Returns:
- The properties value
- See Also:
 
- 
invokeConstructorDescription copied from interface:MetaObjectProtocolInvokes a constructor for the given arguments. The MetaClass will attempt to pick the best argument which matches the types of the objects passed within the arguments array- Specified by:
- invokeConstructorin interface- MetaObjectProtocol
- Overrides:
- invokeConstructorin class- DelegatingMetaClass
- Parameters:
- arguments- The arguments to the constructor
- Returns:
- An instance of the java.lang.Class that this MetaObjectProtocol object applies to
 
- 
invokeMethodDescription copied from interface:MetaObjectProtocolInvokes a method on the given object, with the given name and single argument.- Specified by:
- invokeMethodin interface- MetaObjectProtocol
- Overrides:
- invokeMethodin class- DelegatingMetaClass
- Parameters:
- object- The Object to invoke the method on
- methodName- The name of the method
- arguments- The argument to the method
- Returns:
- The return value of the method which is null if the return type is void
- See Also:
 
- 
invokeMethodDescription copied from interface:MetaObjectProtocolInvokes a method on the given Object with the given name and arguments. The MetaClass will attempt to pick the best method for the given name and arguments. If a method cannot be invoked a MissingMethodException will be thrown.- Specified by:
- invokeMethodin interface- MetaObjectProtocol
- Overrides:
- invokeMethodin class- DelegatingMetaClass
- Parameters:
- object- The instance which the method is invoked on
- methodName- The name of the method
- arguments- The arguments to the method
- Returns:
- The return value of the method which is null if the return type is void
- See Also:
 
- 
getOwnerMetaClass
- 
invokeStaticMethodDescription copied from interface:MetaObjectProtocolInvokes a static method on the given Object with the given name and arguments.The 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 - Specified by:
- invokeStaticMethodin interface- MetaObjectProtocol
- Overrides:
- invokeStaticMethodin class- DelegatingMetaClass
- Parameters:
- object- An instance of the class returned by the getTheClass() method or the class itself
- methodName- The name of the method
- arguments- The arguments to the method
- Returns:
- The return value of the method which is null if the return type is void
- See Also:
 
- 
setAttributeDescription copied from interface:MetaObjectProtocolSets an attribute of an instance of the class returned by the getTheClass() method.What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to set a field of the instance. - Specified by:
- setAttributein interface- MetaObjectProtocol
- Overrides:
- setAttributein class- DelegatingMetaClass
- Parameters:
- object- An instance of the class returned by the getTheClass() method
- attribute- The name of the attribute to set
- newValue- The new value of the attribute
- See Also:
 
- 
setPropertyDescription copied from interface:MetaObjectProtocolSets a property of an instance of the class returned by the getTheClass() method.What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean setter, or if no such setter exists to set a public field of the instance. - Specified by:
- setPropertyin interface- MetaObjectProtocol
- Overrides:
- setPropertyin class- DelegatingMetaClass
- Parameters:
- object- An instance of the class returned by the getTheClass() method
- property- The name of the property to set
- newValue- The new value of the property
- See Also:
 
- 
equals- Overrides:
- equalsin class- DelegatingMetaClass
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- DelegatingMetaClass
 
- 
toString- Overrides:
- toStringin class- DelegatingMetaClass
 
- 
getAttributeDescription copied from interface:MetaClassRetrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.- Specified by:
- getAttributein interface- MetaClass
- Overrides:
- getAttributein class- DelegatingMetaClass
- Parameters:
- sender- The class of the object that requested the attribute
- receiver- The instance
- messageName- The name of the attribute
- useSuper- Whether to look-up on the super class or not
- Returns:
- The attribute value
 
- 
getPropertypublic Object getProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass) Description copied from interface: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 - Specified by:
- getPropertyin interface- MetaClass
- Overrides:
- getPropertyin class- DelegatingMetaClass
- Parameters:
- sender- The java.lang.Class instance that requested the property
- receiver- The Object which the property is being retrieved from
- messageName- The name of the property
- useSuper- Whether the call is to a super class property
- fromInsideClass- ??
- Returns:
- The properties value
 
- 
getMetaPropertyDescription copied from interface:MetaObjectProtocolReturns a MetaProperty for the given name or null if it doesn't exist- Specified by:
- getMetaPropertyin interface- MetaObjectProtocol
- Overrides:
- getMetaPropertyin class- DelegatingMetaClass
- Parameters:
- name- The name of the MetaProperty
- Returns:
- A MetaProperty or null
 
- 
getStaticMetaMethodDescription copied from interface:MetaObjectProtocolRetrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethod- Specified by:
- getStaticMetaMethodin interface- MetaObjectProtocol
- Overrides:
- getStaticMetaMethodin class- DelegatingMetaClass
- Parameters:
- name- The name of the MetaMethod
- args- The argument types
- Returns:
- A MetaMethod or null if it doesn't exist
 
- 
getStaticMetaMethod- Overrides:
- getStaticMetaMethodin class- DelegatingMetaClass
 
- 
getMetaMethodDescription copied from interface:MetaObjectProtocolRetrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod- Specified by:
- getMetaMethodin interface- MetaObjectProtocol
- Overrides:
- getMetaMethodin class- DelegatingMetaClass
- Parameters:
- name- The name of the MetaMethod
- args- Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types
- Returns:
- A MetaMethod or null if it doesn't exist
 
- 
getMetaMethod
- 
getTheClassDescription copied from interface:MetaObjectProtocolRetrieves that Java Class that the attached Meta behaviours apply to- Specified by:
- getTheClassin interface- MetaObjectProtocol
- Overrides:
- getTheClassin class- DelegatingMetaClass
- Returns:
- The java.lang.Class instance
 
- 
invokeMethodpublic Object invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass) Description copied from interface:MetaClassInvokes 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 - Specified by:
- invokeMethodin interface- MetaClass
- Overrides:
- invokeMethodin class- DelegatingMetaClass
- Parameters:
- sender- The java.lang.Class instance that invoked the method
- receiver- The object which the method was invoked on
- methodName- The name of the method
- arguments- The arguments to the method
- isCallToSuper- Whether the method is a call to a super class method
- fromInsideClass- Whether the call was invoked from the inside or the outside of the class
- Returns:
- The return value of the method
 
- 
invokeMissingMethodDescription copied from interface:MetaClassAttempts to invoke the methodMissing method otherwise throws a MissingMethodException - Specified by:
- invokeMissingMethodin interface- MetaClass
- Overrides:
- invokeMissingMethodin class- DelegatingMetaClass
- Parameters:
- instance- The instance to invoke methodMissing on
- methodName- The name of the method
- arguments- The arguments to the method
- Returns:
- The results of methodMissing or throws MissingMethodException
- See Also:
 
- 
invokeMissingPropertypublic Object invokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter) Description copied from interface:MetaClassInvokes the propertyMissing method otherwise throws a MissingPropertyException- Specified by:
- invokeMissingPropertyin interface- MetaClass
- Overrides:
- invokeMissingPropertyin class- DelegatingMetaClass
- Parameters:
- instance- The instance of the class
- propertyName- The name of the property
- optionalValue- The value of the property which could be null in the case of a getter
- isGetter- Whether the missing property event was the result of a getter or a setter
- Returns:
- The result of the propertyMissing method or throws MissingPropertyException
 
- 
isGroovyObjectpublic boolean isGroovyObject()- Overrides:
- isGroovyObjectin class- DelegatingMetaClass
 
- 
setAttributepublic void setAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass) Description copied from interface:MetaClassSets the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.- Specified by:
- setAttributein interface- MetaClass
- Overrides:
- setAttributein class- DelegatingMetaClass
- Parameters:
- sender- The class of the object that requested the attribute
- receiver- The instance
- messageName- The name of the attribute
- messageValue- The value of the attribute
- useSuper- Whether to look-up on the super class or not
- fromInsideClass- Whether the call happened from the inside or the outside of a class
 
- 
setPropertypublic void setProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass) Description copied from interface:MetaClassSets a property on the given receiver for the specified arguments. The sender is the class that is setting 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 - Specified by:
- setPropertyin interface- MetaClass
- Overrides:
- setPropertyin class- DelegatingMetaClass
- Parameters:
- sender- The java.lang.Class instance that is mutating the property
- receiver- The Object which the property is being set on
- messageName- The name of the property
- messageValue- The new value of the property to set
- useSuper- Whether the call is to a super class property
- fromInsideClass- Whether the call was invoked from the inside or the outside of the class
 
- 
selectConstructorAndTransformArgumentsDescription copied from interface:MetaClassInternal method to support Groovy runtime. Not for client usage.- Specified by:
- selectConstructorAndTransformArgumentsin interface- MetaClass
- Overrides:
- selectConstructorAndTransformArgumentsin class- DelegatingMetaClass
- Parameters:
- numberOfConstructors- The number of constructors
- arguments- The arguments
- Returns:
- selected index
 
 
-