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.
  • 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