Class ClosureMetaClass

java.lang.Object
groovy.lang.MetaClassImpl
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass
All Implemented Interfaces:
MetaClass, MetaObjectProtocol, MutableMetaClass

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!

Since:
1.5