Class SimpleMethodProcessor
java.lang.Object
net.neoforged.neoforgespi.transformation.BaseSimpleProcessor
net.neoforged.neoforgespi.transformation.SimpleMethodProcessor
- All Implemented Interfaces:
ClassProcessor
- Direct Known Subclasses:
ReplaceFieldComparisonWithInstanceOf
Base class for simple
ClassProcessor implementations that want to apply
bytecode transformations to specific methods.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordIdentifies a targeted method and the class it resides in.Nested classes/interfaces inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
ClassProcessor.AfterProcessingContext, ClassProcessor.ComputeFlags, ClassProcessor.LinkContext, ClassProcessor.OrderingHint, ClassProcessor.SelectionContext, ClassProcessor.TransformationContext -
Field Summary
FieldsFields inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
GENERATED_PACKAGE_MODULE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns whether the processor wants to recieve the class.Each class that the processor has opted to recieve is passed to this method for processing.abstract Set<SimpleMethodProcessor.Target> targets()Returns the methods targeted by this processor.abstract voidtransform(org.objectweb.asm.tree.MethodNode input, SimpleTransformationContext context) Applies transformations to a targeted method.Methods inherited from class net.neoforged.neoforgespi.transformation.BaseSimpleProcessor
afterProcessing, link, runsAfterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
generatesPackages, name, orderingHint, runsBefore
-
Field Details
-
targetsByClass
-
-
Constructor Details
-
SimpleMethodProcessor
public SimpleMethodProcessor()
-
-
Method Details
-
transform
public abstract void transform(org.objectweb.asm.tree.MethodNode input, SimpleTransformationContext context) Applies transformations to a targeted method.- Parameters:
input- The ASM input node, which can be mutated directly
-
targets
Returns the methods targeted by this processor.- Returns:
- the methods targeted by this processor
-
targetsByClass
-
handlesClass
Description copied from interface:ClassProcessorReturns whether the processor wants to recieve the class.- Parameters:
context- the context of the class to consider- Returns:
- whether the processor wants to recieve the class
-
processClass
Description copied from interface:ClassProcessorEach class that the processor has opted to recieve is passed to this method for processing.- Parameters:
context- the context of the class to process- Returns:
- the
ClassProcessor.ComputeFlagsindicating how the class should be rewritten.
-