|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.MetaClassImpl org.codehaus.groovy.runtime.metaclass.ClosureMetaClass
public final class ClosureMetaClass extends MetaClassImpl
A meta class for closures generated by the Groovy compiler. These classes have special characteristics this MetaClass uses. One of these is that a generated Closure has only additional doCall methods, all other methods are in the Closure class as well. To use this fact this MetaClass uses a MetaClass for Closure as static field And delegates calls to this MetaClass if needed. This allows a lean implementation for this MetaClass. Multiple generated closures will then use the same MetaClass for Closure. For static dispatching this class uses the MetaClass of Class, again all instances of this class will share that MetaClass. The Class MetaClass is initialized lazy, because most operations do not need this MetaClass.
The Closure and Class MetaClasses are not replaceable. This MetaClass is for internal usage only!Field Summary |
---|
Method Summary | |
---|---|
java.lang.Object
|
ClosureMetaClass(MetaClassRegistry registry, java.lang.Class theClass)
|
void
|
addMetaBeanProperty(MetaBeanProperty mp)
|
void
|
addMetaMethod(MetaMethod method)
|
void
|
addNewInstanceMethod(java.lang.reflect.Method method)
|
void
|
addNewStaticMethod(java.lang.reflect.Method method)
|
protected void
|
applyPropertyDescriptors(java.beans.PropertyDescriptor[] propertyDescriptors)
|
CallSite
|
createPogoCallCurrentSite(CallSite site, java.lang.Class sender, java.lang.Object[] args)
|
CallSite
|
createPogoCallSite(CallSite site, java.lang.Object[] args)
|
CallSite
|
createPojoCallSite(CallSite site, java.lang.Object receiver, java.lang.Object[] args)
|
java.lang.Object
|
getAttribute(java.lang.Class sender, java.lang.Object object, java.lang.String attribute, boolean useSuper, boolean fromInsideClass)
|
java.util.List
|
getMetaMethods()
|
MetaProperty
|
getMetaProperty(java.lang.String name)
|
MetaMethod
|
getMethodWithoutCaching(int index, java.lang.Class sender, java.lang.String methodName, java.lang.Class[] arguments, boolean isCallToSuper)
|
java.util.List
|
getMethods()
|
java.util.List
|
getProperties()
|
java.lang.Object
|
getProperty(java.lang.Class sender, java.lang.Object object, java.lang.String name, boolean useSuper, boolean fromInsideClass)
|
MetaMethod
|
getStaticMetaMethod(java.lang.String name, java.lang.Object[] args)
|
MetaMethod
|
getStaticMetaMethod(java.lang.String name, java.lang.Class[] argTypes)
|
void
|
initialize()
|
java.lang.Object
|
invokeMethod(java.lang.Class sender, java.lang.Object object, java.lang.String methodName, java.lang.Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)
|
java.lang.Object
|
invokeStaticMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
|
protected boolean
|
isInitialized()
|
MetaMethod
|
pickMethod(java.lang.String name, java.lang.Class[] argTypes)
|
java.util.List
|
respondsTo(java.lang.Object obj, java.lang.String name, java.lang.Object[] argTypes)
|
java.util.List
|
respondsTo(java.lang.Object obj, java.lang.String name)
|
java.lang.reflect.Constructor
|
retrieveConstructor(java.lang.Class[] arguments)
|
MetaMethod
|
retrieveStaticMethod(java.lang.String methodName, java.lang.Class[] arguments)
|
void
|
setAttribute(java.lang.Class sender, java.lang.Object object, java.lang.String attribute, java.lang.Object newValue, boolean useSuper, boolean fromInsideClass)
|
void
|
setProperties(java.lang.Object bean, java.util.Map map)
|
void
|
setProperty(java.lang.Class sender, java.lang.Object object, java.lang.String name, java.lang.Object newValue, boolean useSuper, boolean fromInsideClass)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
public java.lang.Object ClosureMetaClass(MetaClassRegistry registry, java.lang.Class theClass)
public void addMetaBeanProperty(MetaBeanProperty mp)
public void addMetaMethod(MetaMethod method)
public void addNewInstanceMethod(java.lang.reflect.Method method)
public void addNewStaticMethod(java.lang.reflect.Method method)
protected void applyPropertyDescriptors(java.beans.PropertyDescriptor[] propertyDescriptors)
public CallSite createPogoCallCurrentSite(CallSite site, java.lang.Class sender, java.lang.Object[] args)
public CallSite createPogoCallSite(CallSite site, java.lang.Object[] args)
public CallSite createPojoCallSite(CallSite site, java.lang.Object receiver, java.lang.Object[] args)
if (mfp == null) { public java.lang.Object getAttribute(java.lang.Class sender, java.lang.Object object, java.lang.String attribute, boolean useSuper, boolean fromInsideClass)
protected boolean isInitialized() { public java.util.List getMetaMethods()
public MetaProperty getMetaProperty(java.lang.String name)
public MetaMethod getMethodWithoutCaching(int index, java.lang.Class sender, java.lang.String methodName, java.lang.Class[] arguments, boolean isCallToSuper)
return CLOSURE_METACLASS.getMetaMethod(name, argTypes); public java.util.List getMethods()
return CLOSURE_METACLASS.getStaticMetaMethod(name, args); public java.util.List getProperties()
public java.lang.Object getProperty(java.lang.Class sender, java.lang.Object object, java.lang.String name, boolean useSuper, boolean fromInsideClass)
public MetaMethod getStaticMetaMethod(java.lang.String name, java.lang.Object[] args)
public MetaMethod getStaticMetaMethod(java.lang.String name, java.lang.Class[] argTypes)
public void initialize()
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)
public java.lang.Object invokeStaticMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
protected boolean isInitialized()
} public MetaMethod pickMethod(java.lang.String name, java.lang.Class[] argTypes)
public java.util.List respondsTo(java.lang.Object obj, java.lang.String name, java.lang.Object[] argTypes)
public java.util.List respondsTo(java.lang.Object obj, java.lang.String name)
public java.lang.reflect.Constructor retrieveConstructor(java.lang.Class[] arguments)
public MetaMethod retrieveStaticMethod(java.lang.String methodName, java.lang.Class[] arguments)
} else { public void setAttribute(java.lang.Class sender, java.lang.Object object, java.lang.String attribute, java.lang.Object newValue, boolean useSuper, boolean fromInsideClass)
public void setProperties(java.lang.Object bean, java.util.Map map)
public void setProperty(java.lang.Class sender, java.lang.Object object, java.lang.String name, java.lang.Object newValue, boolean useSuper, boolean fromInsideClass)
Groovy Documentation