org.codehaus.groovy.runtime.metaclass
Interface ClosureMetaClass

A Metaclass 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 isntances 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!

author:
Jochen Theodorou
since:
1.1

Field Summary
 String CLOSURE_CALL_METHOD
           
 String CLOSURE_CURRY_METHOD
           
 String CLOSURE_DO_CALL_METHOD
           
 MetaClassImpl CLOSURE_METACLASS
           
 def EMPTY_ARGUMENTS
           
 boolean attributeInitDone
           
 Map attributes
           
 MethodChooser chooser
           
 MetaClassImpl classMetaClass
           
 FastArray closureMethods
           
 boolean initialized
           
 
 
Method Summary
Object chooseMethod(def arguments, boolean coerce)
          
static MetaClass getStaticMetaClass()
          
 

Method Detail

chooseMethod

public Object chooseMethod(def arguments, boolean coerce)


getStaticMetaClass

static MetaClass getStaticMetaClass()