Package groovy.lang
Interface MutableMetaClass
- 
- All Superinterfaces:
- MetaClass,- MetaObjectProtocol
 - All Known Implementing Classes:
- ClosureMetaClass,- DelegatingMetaClass,- ExpandoMetaClass,- HandleMetaClass,- MetaClassImpl,- MixedInMetaClass,- MockProxyMetaClass,- OwnedMetaClass,- ProxyMetaClass
 
 public interface MutableMetaClass extends MetaClass An interface that defines methods that implementers of mutable Meta classes should specify. It provides operations to perform mutations on the MetaClass instance.Whether a MetaClass allows mutation is up to the MetaClass itself and considerations of Thread safety need to be taken into account when making a MetaClass mutable The default implementation allows mutation of MetaClass instances before initialisation (before the initialize() method is called) but not after, thus ensuring Thread safety once a MetaClass has been constructed and placed in the registry - Since:
- 1.5
- See Also:
- MetaClassImpl,- MetaClass
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMetaBeanProperty(MetaBeanProperty metaBeanProperty)Adds a new MetaBeanProperty to the MetaClassvoidaddMetaMethod(MetaMethod metaMethod)Adds a new MetaMethod to the MetaClassvoidaddNewInstanceMethod(java.lang.reflect.Method method)adds a new instance method to this MetaClass.voidaddNewStaticMethod(java.lang.reflect.Method method)adds a new static method to this MetaClass.booleanisModified()Return whether the MetaClass has been modified or not- 
Methods inherited from interface groovy.lang.MetaClassgetAttribute, getClassNode, getMetaMethods, getMethods, getProperties, getProperty, initialize, invokeMethod, invokeMissingMethod, invokeMissingProperty, pickMethod, selectConstructorAndTransformArguments, setAttribute, setProperty
 - 
Methods inherited from interface groovy.lang.MetaObjectProtocolgetAttribute, getMetaMethod, getMetaProperty, getProperty, getStaticMetaMethod, getTheClass, hasProperty, invokeConstructor, invokeMethod, invokeMethod, invokeStaticMethod, respondsTo, respondsTo, setAttribute, setProperty
 
- 
 
- 
- 
- 
Method Detail- 
isModifiedboolean isModified() Return whether the MetaClass has been modified or not- Returns:
- True if it has
 
 - 
addNewInstanceMethodvoid addNewInstanceMethod(java.lang.reflect.Method method) 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- the method to be added
 
 - 
addNewStaticMethodvoid addNewStaticMethod(java.lang.reflect.Method method) adds a new static method to this MetaClass. This is only possible as long as initialise was not called.- Parameters:
- method- the method to be added
 
 - 
addMetaMethodvoid addMetaMethod(MetaMethod metaMethod) Adds a new MetaMethod to the MetaClass- Parameters:
- metaMethod- The MetaMethod to add
 
 - 
addMetaBeanPropertyvoid addMetaBeanProperty(MetaBeanProperty metaBeanProperty) Adds a new MetaBeanProperty to the MetaClass- Parameters:
- metaBeanProperty- The MetaBeanProperty instance
 
 
- 
 
-