Class ArgsClassGenerator
- java.lang.Object
-
- org.spongepowered.asm.mixin.injection.invoke.arg.ArgsClassGenerator
-
- All Implemented Interfaces:
IClassGenerator
public final class ArgsClassGenerator extends java.lang.Object implements IClassGenerator
Class generator which creates subclasses ofArgsto be used by theModifyArgsinjector. 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 Modifier and Type Field Description static java.lang.StringARGS_NAMEstatic java.lang.StringARGS_REFstatic java.lang.StringGETTER_PREFIXstatic java.lang.StringSYNTHETIC_PACKAGE
-
Constructor Summary
Constructors Constructor Description ArgsClassGenerator(IConsumer<ISyntheticClassInfo> registry)Ctor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangenerate(java.lang.String name, org.objectweb.asm.tree.ClassNode classNode)Generate (if possible) the specified class name.ISyntheticClassInfogetArgsClass(java.lang.String desc, IMixinInfo mixin)Get (or generate) the class name for the specified descriptor.java.lang.StringgetName()Get the name of this generator for logging and auditing purposes
-
-
-
Field Detail
-
ARGS_NAME
public static final java.lang.String ARGS_NAME
-
ARGS_REF
public static final java.lang.String ARGS_REF
-
GETTER_PREFIX
public static final java.lang.String GETTER_PREFIX
- See Also:
- Constant Field Values
-
SYNTHETIC_PACKAGE
public static final java.lang.String SYNTHETIC_PACKAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArgsClassGenerator
public ArgsClassGenerator(IConsumer<ISyntheticClassInfo> registry)
Ctor- Parameters:
registry- sythetic class registry
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:IClassGeneratorGet the name of this generator for logging and auditing purposes- Specified by:
getNamein interfaceIClassGenerator
-
getArgsClass
public ISyntheticClassInfo getArgsClass(java.lang.String desc, IMixinInfo mixin)
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
public boolean generate(java.lang.String name, org.objectweb.asm.tree.ClassNode classNode)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
-
-