Package io.papermc.asm.rules.method
Interface StaticRewrite
- All Superinterfaces:
MethodRewriteRule,OwnableMethodRewriteRule,OwnableMethodRewriteRule.Filtered,OwnableRewriteRule,RewriteRule
- All Known Subinterfaces:
StaticRewrite.Generated,StaticRewrite.Generated.Param,StaticRewrite.Generated.Return
- All Known Implementing Classes:
StaticRewrites.DirectParam,StaticRewrites.DirectReturn,StaticRewrites.FuzzyParam,StaticRewrites.Plain
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic final recordNested classes/interfaces inherited from interface io.papermc.asm.rules.method.MethodRewriteRule
MethodRewriteRule.GeneratorInfo<D extends GeneratedMethodHolder.CallData>, MethodRewriteRule.MethodGenerator, MethodRewriteRule.Rewrite<D extends GeneratedMethodHolder.CallData>, MethodRewriteRule.RewriteSingleNested classes/interfaces inherited from interface io.papermc.asm.rules.method.OwnableMethodRewriteRule
OwnableMethodRewriteRule.FilteredNested 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 MethodRewriteRule.Rewrite<?>rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface) 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
createVisitorMethods inherited from interface io.papermc.asm.rules.method.OwnableMethodRewriteRule.Filtered
methodMatcher, shouldProcessMethods inherited from interface io.papermc.asm.rules.OwnableRewriteRule
matchesOwner, owners
-
Field Details
-
CONSTRUCTOR_METHOD_NAME
- See Also:
-
GENERATED_PREFIX
- 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 MethodRewriteRule.Rewrite<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 MethodRewriteRule.Rewrite<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 MethodRewriteRule.Rewrite<?> rewrite(ClassProcessingContext context, boolean isInvokeDynamic, int opcode, ClassDesc owner, String name, MethodTypeDesc descriptor, boolean isInterface) - Specified by:
rewritein interfaceMethodRewriteRule
-