Class ArgsClassGenerator
java.lang.Object
org.spongepowered.asm.mixin.injection.invoke.arg.ArgsClassGenerator
- All Implemented Interfaces:
IClassGenerator
Class generator which creates subclasses of
Args to be used by the
ModifyArgs injector. The subclasses contain getter and setter logic
to provide access to a particular configuration of arguments and classes are
only generated for each unique argument combination.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGenerate (if possible) the specified class name.getArgsClass(String desc, IMixinInfo mixin) Get (or generate) the class name for the specified descriptor.getName()Get the name of this generator for logging and auditing purposes
-
Field Details
-
ARGS_NAME
-
ARGS_REF
-
GETTER_PREFIX
- See Also:
-
SYNTHETIC_PACKAGE
- See Also:
-
-
Constructor Details
-
ArgsClassGenerator
Ctor- Parameters:
registry- sythetic class registry
-
-
Method Details
-
getName
Description copied from interface:IClassGeneratorGet the name of this generator for logging and auditing purposes- Specified by:
getNamein interfaceIClassGenerator
-
getArgsClass
Get (or generate) the class name for the specified descriptor. The class will not be generated until it is used. Calling this method simply allocates a name for the specified descriptor.- Parameters:
desc- Descriptor of the target method, the return type is ignored for the purposes of generating Args subclassesmixin- Mixin which requires the class. Only the first mixin to request a class will be registered against it but this is for debugging only anyway- Returns:
- name of the Args subclass to use
-
generate
Description copied from interface:IClassGeneratorGenerate (if possible) the specified class name. The generator should return null if it cannot generate the specified class, in order that the next generator in the chain can process the request. The first generator to return a value will halt further processing of the request.- Specified by:
generatein interfaceIClassGenerator- Parameters:
name- Class name to generateclassNode- Empty ClassNode to populate- Returns:
- True if the class was generated
-