Package io.papermc.asm.rules.method
Interface StaticRewrite
- All Superinterfaces:
MethodRewriteRule,RewriteRule
- All Known Subinterfaces:
GeneratedStaticRewrite,TargetedTypeGeneratedStaticRewrite,TargetedTypeGeneratedStaticRewrite.Parameter,TargetedTypeGeneratedStaticRewrite.Return
- All Known Implementing Classes:
DirectParameterRewrite,DirectReturnRewrite,DirectStaticRewrite,FuzzyParameterRewrite,MoveInstanceMethod
-
Nested Class Summary
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.method.MethodRewriteRule
LAMBDA_METAFACTORY_OWNERFields inherited from interface io.papermc.asm.rules.RewriteRule
EMPTY -
Method Summary
Modifier and TypeMethodDescriptioncreateConstructorRewrite(ClassProcessingContext context, MethodTypeDesc intermediateDescriptor, GeneratedMethodHolder.ConstructorCallData originalCallData) Creates a rewrite for the given constructor call data.createRewrite(ClassProcessingContext context, MethodTypeDesc intermediateDescriptor, GeneratedMethodHolder.MethodCallData originalCallData) Creates a rewrite for the given method call data.default @Nullable MethodRewrite<?>rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface) Creates aMethodRewritewhich will be applied to the processed bytecode.default MethodTypeDesctransformToRedirectDescriptor(MethodTypeDesc intermediateDescriptor) Transforms the intermediate descriptor to the final descriptor that will be used in the rewritten bytecode.Methods inherited from interface io.papermc.asm.rules.method.MethodRewriteRule
createVisitor, shouldProcess
-
Field Details
-
CONSTRUCTOR_METHOD_NAME
- See Also:
-
-
Method Details
-
staticRedirectOwner
-
transformToRedirectDescriptor
Transforms the intermediate descriptor to the final descriptor that will be used in the rewritten bytecode.Intermediate means that it has been modified from the original accounting for the virtual/interface/static/constructor-ness of the method call.
- Parameters:
intermediateDescriptor- the intermediate descriptor- Returns:
- the final descriptor to be used in the rewritten bytecode
-
createRewrite
default MethodRewrite<GeneratedMethodHolder.MethodCallData> createRewrite(ClassProcessingContext context, MethodTypeDesc intermediateDescriptor, GeneratedMethodHolder.MethodCallData originalCallData) Creates a rewrite for the given method call data.- Parameters:
context- the contextintermediateDescriptor- the descriptor modified from the original to account for the method call type (interface, virtual, static, etc.)originalCallData- the original method call data- Returns:
- the rewrite
-
createConstructorRewrite
default MethodRewrite<GeneratedMethodHolder.ConstructorCallData> createConstructorRewrite(ClassProcessingContext context, MethodTypeDesc intermediateDescriptor, GeneratedMethodHolder.ConstructorCallData originalCallData) Creates a rewrite for the given constructor call data.- Parameters:
context- the contextintermediateDescriptor- the descriptor modified from the original to include a return typeoriginalCallData- the original constructor call data- Returns:
- the rewrite
-
rewrite
default @Nullable MethodRewrite<?> rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface) Description copied from interface:MethodRewriteRuleCreates aMethodRewritewhich will be applied to the processed bytecode.- Specified by:
rewritein interfaceMethodRewriteRule- Parameters:
context- the current contextisInvokeDynamic- if this is in an invokedynamic instructionopcode- the opcode of the invoke instruction or the invokedynamic handle tagowner- the owner of the invoke method or the owner of the invokedynamic handlename- the name of the invoke method or the name of the invokedynamic handledescriptor- the descriptor of the invoke method or the descriptor of the invokedynamic handleisInterface- if the method is an interface method- Returns:
- the rewrite or null if no rewrite should be applied
-