Class CachedClosureClass
java.lang.Object
org.codehaus.groovy.reflection.CachedClass
org.codehaus.groovy.reflection.stdclasses.CachedClosureClass
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
ConstructorsConstructorDescriptionCachedClosureClass(Class klazz, ClassInfo classInfo) Constructs a cached class representation for a closure class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of parameters accepted by the closure'sdoCallmethods.Class[]Returns the parameter types of the closure'sdoCallmethod 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
-
Constructor Details
-
CachedClosureClass
Constructs a cached class representation for a closure class. Inspects the closure'sdoCallmethods to extract parameter metadata.- Parameters:
klazz- the closure class to cacheclassInfo- the class information associated with this cached class
-
-
Method Details
-
getParameterTypes
Returns the parameter types of the closure'sdoCallmethod with maximum parameters.- Returns:
- the parameter types array, or
nullif nodoCallmethod was found
-
getMaximumNumberOfParameters
public int getMaximumNumberOfParameters()Returns the maximum number of parameters accepted by the closure'sdoCallmethods.- Returns:
- the maximum number of parameters, or
0if nodoCallmethod was found
-