Package org.codehaus.groovy.classgen.asm
Class MethodCallerMultiAdapter
java.lang.Object
org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter
Multi-adapter for method callers that handles different argument counts and safe/spread-safe variants.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of direct (non-N-arg) argument slots; variants above this use the N-arg method. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcall(org.objectweb.asm.MethodVisitor methodVisitor, int numberOfArguments, boolean safe, boolean spreadSafe) Invokes the appropriate method based on argument count and safety flags.static MethodCallerMultiAdapterCreates a multi-adapter for static methods with optional safe and spread-safe variants.
-
Field Details
-
MAX_ARGS
public static final int MAX_ARGSMaximum number of direct (non-N-arg) argument slots; variants above this use the N-arg method.- See Also:
-
-
Constructor Details
-
MethodCallerMultiAdapter
public MethodCallerMultiAdapter()
-
-
Method Details
-
newStatic
public static MethodCallerMultiAdapter newStatic(Class theClass, String baseName, boolean createNArgs, boolean skipSpreadSafeAndSafe) Creates a multi-adapter for static methods with optional safe and spread-safe variants.- Parameters:
theClass- the class containing the methodsbaseName- the base method namecreateNArgs- whether to create numbered argument variantsskipSpreadSafeAndSafe- whether to skip safe and spread-safe variants- Returns:
- a new MethodCallerMultiAdapter
-
call
public void call(org.objectweb.asm.MethodVisitor methodVisitor, int numberOfArguments, boolean safe, boolean spreadSafe) Invokes the appropriate method based on argument count and safety flags.- Parameters:
methodVisitor- the method visitor to write tonumberOfArguments- a value > 0 describing how many arguments are additionally used for the method callsafe- whether to use the safe variantspreadSafe- whether to use the spread-safe variant
-