Top Inners Fields Constructors Methods
org.codehaus.groovy.runtime

public Class HandleMetaClass

extends DelegatingMetaClass
Class Inheritance
Imports
groovy.lang.DelegatingMetaClass, .ExpandoMetaClass, .GroovyObject, .MetaBeanProperty, .MetaClass, .MetaMethod, java.lang.reflect.Method

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Object
private Object
Inherited from groovy.lang.DelegatingMetaClass:
delegate

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addMetaBeanProperty(MetaBeanProperty
The MetaBeanProperty instance
metaBeanProperty
)

Overrides groovy.lang.DelegatingMetaClass.addMetaBeanProperty.

Implements groovy.lang.MutableMetaClass.addMetaBeanProperty.

Adds a new MetaBeanProperty to the MetaClass
public void
addMetaMethod(MetaMethod
The MetaMethod to add
metaMethod
)

Overrides groovy.lang.DelegatingMetaClass.addMetaMethod.

Implements groovy.lang.MutableMetaClass.addMetaMethod.

Adds a new MetaMethod to the MetaClass
public void
addNewInstanceMethod(Method
the method to be added
method
)

Overrides groovy.lang.DelegatingMetaClass.addNewInstanceMethod.

Implements groovy.lang.MutableMetaClass.addNewInstanceMethod.

adds a new instance method to this MetaClass.
public void
addNewStaticMethod(Method
the method to be added
method
)

Overrides groovy.lang.DelegatingMetaClass.addNewStaticMethod.

Implements groovy.lang.MutableMetaClass.addNewStaticMethod.

adds a new static method to this MetaClass.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides groovy.lang.DelegatingMetaClass.equals.

Indicates whether some other object is "equal to" this one.
public Object
getProperty(String
the name of the property of interest
property
)

Overrides groovy.lang.DelegatingMetaClass.getProperty.

Overrides default groovy.lang.GroovyObject.getProperty.

Retrieves a property value.
public void
initialize()

Overrides groovy.lang.DelegatingMetaClass.initialize.

Implements groovy.lang.MetaClass.initialize.

Complete the initialisation process.
public Object
invokeMethod(String
the name of the method to call
name
,
Object
the arguments to use for the method call
args
)

Overrides groovy.lang.DelegatingMetaClass.invokeMethod.

Overrides default groovy.lang.GroovyObject.invokeMethod.

Invokes the given method.
public GroovyObject
public void
setProperty(String
the name of the property of interest
property
,
Object
the new value for the property
newValue
)

Overrides groovy.lang.DelegatingMetaClass.setProperty.

Overrides default groovy.lang.GroovyObject.setProperty.

Sets the given property to the new value.
Inherited from groovy.lang.DelegatingMetaClass:
getAdapteegetAttributegetAttributegetClassNodegetMetaClassgetMetaMethodgetMetaMethodsgetMetaPropertygetMethodsgetPropertiesgetPropertygetPropertygetStaticMetaMethodgetStaticMetaMethodgetTheClasshashCodehasPropertyinvokeConstructorinvokeMethodinvokeMethodinvokeMethodinvokeMissingMethodinvokeMissingPropertyinvokeStaticMethodisGroovyObjectisModifiedpickMethodrespondsTorespondsToselectConstructorAndTransformArgumentssetAdapteesetAttributesetAttributesetMetaClasssetPropertysetPropertytoString

Field Detail

NONEback to summary
private static final Object NONE
objectback to summary
private Object object

Constructor Detail

HandleMetaClassback to summary
public HandleMetaClass(MetaClass mc)
HandleMetaClassback to summary
public HandleMetaClass(MetaClass mc, Object obj)

Method Detail

addMetaBeanPropertyback to summary
public void addMetaBeanProperty(MetaBeanProperty metaBeanProperty)

Overrides groovy.lang.DelegatingMetaClass.addMetaBeanProperty.

Implements groovy.lang.MutableMetaClass.addMetaBeanProperty.

Doc from groovy.lang.MutableMetaClass.addMetaBeanProperty.

Adds a new MetaBeanProperty to the MetaClass

Parameters
metaBeanProperty:MetaBeanProperty

The MetaBeanProperty instance

addMetaMethodback to summary
public void addMetaMethod(MetaMethod metaMethod)

Overrides groovy.lang.DelegatingMetaClass.addMetaMethod.

Implements groovy.lang.MutableMetaClass.addMetaMethod.

Doc from groovy.lang.MutableMetaClass.addMetaMethod.

Adds a new MetaMethod to the MetaClass

Parameters
metaMethod:MetaMethod

The MetaMethod to add

addNewInstanceMethodback to summary
public void addNewInstanceMethod(Method method)

Overrides groovy.lang.DelegatingMetaClass.addNewInstanceMethod.

Implements groovy.lang.MutableMetaClass.addNewInstanceMethod.

Doc from groovy.lang.MutableMetaClass.addNewInstanceMethod.

adds a new instance method to this MetaClass. Instance methods are able to overwrite the original methods of the class. Calling this method should not be done after initialise was called.

Parameters
method:Method

the method to be added

addNewStaticMethodback to summary
public void addNewStaticMethod(Method method)

Overrides groovy.lang.DelegatingMetaClass.addNewStaticMethod.

Implements groovy.lang.MutableMetaClass.addNewStaticMethod.

Doc from groovy.lang.MutableMetaClass.addNewStaticMethod.

adds a new static method to this MetaClass. This is only possible as long as initialise was not called.

Parameters
method:Method

the method to be added

equalsback to summary
public boolean equals(Object obj)

Overrides groovy.lang.DelegatingMetaClass.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getPropertyback to summary
public Object getProperty(String property)

Overrides groovy.lang.DelegatingMetaClass.getProperty.

Overrides default groovy.lang.GroovyObject.getProperty.

Doc from groovy.lang.GroovyObject.getProperty.

Retrieves a property value.

Parameters
property:String

the name of the property of interest

Returns:Object

the given property

initializeback to summary
public void initialize()

Overrides groovy.lang.DelegatingMetaClass.initialize.

Implements groovy.lang.MetaClass.initialize.

Doc from groovy.lang.MetaClass.initialize.

Complete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.

invokeMethodback to summary
public Object invokeMethod(String name, Object args)

Overrides groovy.lang.DelegatingMetaClass.invokeMethod.

Overrides default groovy.lang.GroovyObject.invokeMethod.

Doc from groovy.lang.GroovyObject.invokeMethod.

Invokes the given method.

Parameters
name:String

the name of the method to call

args:Object

the arguments to use for the method call

Returns:Object

the result of invoking the method

replaceDelegateback to summary
public GroovyObject replaceDelegate()
setPropertyback to summary
public void setProperty(String property, Object newValue)

Overrides groovy.lang.DelegatingMetaClass.setProperty.

Overrides default groovy.lang.GroovyObject.setProperty.

Doc from groovy.lang.GroovyObject.setProperty.

Sets the given property to the new value.

Parameters
property:String

the name of the property of interest

newValue:Object

the new value for the property

org.codehaus.groovy.runtime back to summary

private Class HandleMetaClass.Holder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final MetaClass

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

META_CLASSback to summary
pack-priv static final MetaClass META_CLASS

Constructor Detail

Holderback to summary
private Holder()