Package org.apache.groovy.metaclass
Class Realm
java.lang.Object
org.apache.groovy.metaclass.Realm
A Realm is the representation of a metaclass layer in a tree of realm objects.
-
Method Summary
Modifier and TypeMethodDescription<T> MetaClass<T>getMetaClass(Class<T> theClass) Returns aMetaClasswhose constant is cached on this realm'sClassValueand re-read when that constant'sSwitchPointis invalidated.static RealmCreates a realm with the given name.toString()
-
Method Details
-
newRealm
Creates a realm with the given name. Anullparent is replaced by the root realm.A null
namefails immediately.- Parameters:
name- realm name; must not benullparent- parent realm, ornullto attach the new realm under the root- Returns:
- the new realm
-
toString
-
getMetaClass
Returns aMetaClasswhose constant is cached on this realm'sClassValueand re-read when that constant'sSwitchPointis invalidated.- Type Parameters:
T- the class the meta-class describes- Parameters:
theClass- the class to look up- Returns:
- a meta-class bound to the cached constant for
theClass
-