Package io.papermc.asm.rules.method
Interface MethodRewriteRule
- All Superinterfaces:
RewriteRule
- All Known Subinterfaces:
OwnableMethodRewriteRule,OwnableMethodRewriteRule.Filtered,StaticRewrite,StaticRewrite.Generated,StaticRewrite.Generated.Param,StaticRewrite.Generated.Return
- All Known Implementing Classes:
MethodRewrites.SubTypeReturn,MethodRewrites.SuperTypeParam,StaticRewrites.DirectParam,StaticRewrites.DirectReturn,StaticRewrites.FuzzyParam,StaticRewrites.Plain
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic interfacestatic interfacestatic final recordHolds the structure of the rewritten method that replaces a matching method found in the bytecode.Nested classes/interfaces inherited from interface io.papermc.asm.rules.RewriteRule
RewriteRule.Chain, RewriteRule.ChainBuilder, RewriteRule.Delegate, RewriteRule.GeneratorAdapterFactory -
Field Summary
FieldsFields inherited from interface io.papermc.asm.rules.RewriteRule
EMPTY -
Method Summary
Modifier and TypeMethodDescriptiondefault ClassVisitorcreateVisitor(int api, ClassVisitor parent, ClassProcessingContext context) rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface) default booleanshouldProcess(ClassProcessingContext context, int opcode, String owner, String name, String descriptor, boolean isInterface) Checks if this rule should even attempt to create aMethodRewriteRule.Rewritefor the current context.
-
Field Details
-
LAMBDA_METAFACTORY_OWNER
- See Also:
-
-
Method Details
-
shouldProcess
default boolean shouldProcess(ClassProcessingContext context, int opcode, String owner, String name, String descriptor, boolean isInterface) Checks if this rule should even attempt to create aMethodRewriteRule.Rewritefor the current context. Returning true here does not mean aMethodRewriteRule.Rewritewill be created, but it's an early exit for rules that know they won't be able to rewrite the method.- Parameters:
context- the current contextopcode- the method opcodeowner- the method owner (with slashes)name- the method namedescriptor- the method descriptorisInterface- if the owning class is an interface- Returns:
- true to continue processing the instruction
-
createVisitor
- Specified by:
createVisitorin interfaceRewriteRule
-
rewrite
@Nullable MethodRewriteRule.Rewrite<?> rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface)
-