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 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 Modifier and Type Field Description static java.lang.StringARGS_NAMEstatic java.lang.StringARGS_REFstatic java.lang.StringGETTER_PREFIX -
Constructor Summary
Constructors Constructor Description ArgsClassGenerator(IConsumer<ISyntheticClassInfo> registry)Ctor -
Method Summary
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 purposesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
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
-
-
Constructor Details
-
ArgsClassGenerator
Ctor- Parameters:
registry- sythetic class registry
-
-
Method Details
-
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
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
-