Package: org.codehaus.groovy.reflection.stdclasses

## [Java] Class CachedClosureClass

- org.codehaus.groovy.reflection.stdclasses.CachedClosureClass

-     public class CachedClosureClass
      extends CachedClass

  Provides optimized reflection caching for Groovy Closure classes. Analyzes closure `doCall` methods to determine parameter types and maximum parameters.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class CachedClass` | `EMPTY_ARRAY, classInfo, isArray, isInterface, isNumber, isPrimitive, modifiers, mopMethods`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CachedClosureClass(Class klazz, ClassInfo classInfo)` Constructs a cached class representation for a closure class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public int` | `getMaximumNumberOfParameters()` Returns the maximum number of parameters accepted by the closure's `doCall` methods.
    `` | `public Class[]` | `getParameterTypes()` Returns the parameter types of the closure's `doCall` method with maximum parameters.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CachedClass` | `addNewMopMethods, coerceArgument, getCachedClass, getCachedSuperClass, getCallSiteLoader, getConstructors, getDeclaredInterfaces, getFields, getHierarchy, getInterfaces, getMethods, getModifiers, getName, getNewMetaMethods, getSuperClassDistance, getTheClass, getTypeDescription, hashCode, isAssignableFrom, isDirectlyAssignable, isInterface, isPrimitive, isVoid, searchMethods, setNewMopMethods, toString`

- - ### Constructor Detail

    - #### public CachedClosureClass(Class klazz, ClassInfo classInfo)

      Constructs a cached class representation for a closure class. Inspects the closure's `doCall` methods to extract parameter metadata.

      Parameters:
        `klazz` - the closure class to cache
        `classInfo` - the class information associated with this cached class

  - ### Method Detail

    - #### public int getMaximumNumberOfParameters()

      Returns the maximum number of parameters accepted by the closure's `doCall` methods.

      Returns:
        the maximum number of parameters, or `0` if no `doCall` method was found

    - #### public Class[] getParameterTypes()

      Returns the parameter types of the closure's `doCall` method with maximum parameters.

      Returns:
        the parameter types array, or `null` if no `doCall` method was found