Package org.codehaus.groovy.reflection.stdclasses

# Class CachedClosureClass

java.lang.Object
org.codehaus.groovy.reflection.CachedClass
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.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.codehaus.groovy.reflection.CachedClass

  `CachedClass.CachedMethodComparatorByName, CachedClass.CachedMethodComparatorWithString`

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.reflection.CachedClass

  `classInfo, EMPTY_ARRAY, isArray, isInterface, isNumber, isPrimitive, modifiers, mopMethods`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getMaximumNumberOfParameters()`
  Returns the maximum number of parameters accepted by the closure's `doCall` methods.
  `Class[]`
  `getParameterTypes()`
  Returns the parameter types of the closure's `doCall` method with maximum parameters.

  ### Methods inherited from class org.codehaus.groovy.reflection.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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CachedClosureClass

    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 Details

  - ### getParameterTypes

    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

  - ### getMaximumNumberOfParameters

    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