Interface ByteCodeAppender
-
- All Known Subinterfaces:
TypeInitializer
- All Known Implementing Classes:
Advice.Appender
,AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.BridgeMethodImplementation.Appender
,AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.ConstructorImplementation.Appender
,AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.FactoryImplementation.Appender
,AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.LambdaMethodImplementation.Appender
,ByteBuddy.EnumerationImplementation.InitializationAppender
,ByteBuddy.EnumerationImplementation.ValuesMethodAppender
,ByteBuddy.RecordConstructorStrategy.Appender
,ByteCodeAppender.Compound
,ByteCodeAppender.Simple
,DefaultMethodCall.Appender
,EqualsMethod.Appender
,ExceptionMethod
,FieldAccessor.ForImplicitProperty.Appender
,FieldAccessor.ForSetter.Appender
,FieldProxy.Binder.FieldGetter.Appender
,FieldProxy.Binder.FieldSetter.Appender
,FieldProxy.Binder.InstanceFieldConstructor.Appender
,FixedValue.ForArgument
,FixedValue.ForNullValue
,FixedValue.ForOriginType.Appender
,FixedValue.ForPoolValue
,FixedValue.ForThisValue.Appender
,FixedValue.ForValue.StaticFieldByteCodeAppender
,HashCodeMethod.Appender
,Implementation.Context.Default.AccessorMethodDelegation
,Implementation.Context.Default.DelegationRecord
,Implementation.Context.Default.FieldGetterDelegation
,Implementation.Context.Default.FieldSetterDelegation
,InvocationHandlerAdapter.ForField.Appender
,InvocationHandlerAdapter.ForInstance.Appender
,InvokeDynamic.Appender
,MethodCall.Appender
,MethodCall.FieldSetting.Appender
,MethodCallProxy.ConstructorCall.Appender
,MethodCallProxy.MethodCall.Appender
,MethodDelegation.Appender
,Morph.Binder.RedirectionProxy.InstanceFieldConstructor.Appender
,Morph.Binder.RedirectionProxy.MethodCall.Appender
,NexusAccessor.InitializationAppender
,Pipe.Binder.Redirection.ConstructorCall.Appender
,Pipe.Binder.Redirection.MethodCall.Appender
,StubMethod
,SuperMethodCall.Appender
,ToStringMethod.Appender
,TypeInitializer.None
,TypeInitializer.Simple
,TypeProxy.MethodCall.Appender
,TypeProxy.SilentConstruction.Appender
,TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge
public interface ByteCodeAppender
An appender that generates the byte code for a given method. This is done by writing the byte code instructions to the given ASMMethodVisitor
.ByteCodeAppender
is not allowed to write annotations to the method or call theMethodVisitor.visitCode()
,MethodVisitor.visitMaxs(int, int)
orMethodVisitor.visitEnd()
methods which is both done by the entity delegating the call to theByteCodeAppender
. This is done in order to allow for the concatenation of several byte code appenders and therefore a more modular description of method implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ByteCodeAppender.Compound
A compound appender that combines a given number of other byte code appenders.static class
ByteCodeAppender.Simple
A simple byte code appender that only represents a given array ofStackManipulation
s.static class
ByteCodeAppender.Size
An immutable description of both the operand stack size and the size of the local variable array that is required to run the code generated by thisByteCodeAppender
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByteCodeAppender.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.
-
-
-
Method Detail
-
apply
ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.- Parameters:
methodVisitor
- The method visitor to which the byte code appender writes its code to.implementationContext
- The implementation context of the current type creation process.instrumentedMethod
- The method that is the target of the instrumentation.- Returns:
- The required size for the applied byte code to run.
-
-