Package net.bytebuddy.asm
Enum Advice.Dispatcher.Inactive
- java.lang.Object
-
- java.lang.Enum<Advice.Dispatcher.Inactive>
-
- net.bytebuddy.asm.Advice.Dispatcher.Inactive
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Advice.Dispatcher.Inactive>
,Advice.Dispatcher
,Advice.Dispatcher.Bound
,Advice.Dispatcher.Resolved
,Advice.Dispatcher.Resolved.ForMethodEnter
,Advice.Dispatcher.Resolved.ForMethodExit
,Advice.Dispatcher.Unresolved
- Enclosing interface:
- Advice.Dispatcher
public static enum Advice.Dispatcher.Inactive extends java.lang.Enum<Advice.Dispatcher.Inactive> implements Advice.Dispatcher.Unresolved, Advice.Dispatcher.Resolved.ForMethodEnter, Advice.Dispatcher.Resolved.ForMethodExit, Advice.Dispatcher.Bound
An implementation for inactive devise that does not write any byte code.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher
Advice.Dispatcher.Bound, Advice.Dispatcher.Delegating, Advice.Dispatcher.Inactive, Advice.Dispatcher.Inlining, Advice.Dispatcher.RelocationHandler, Advice.Dispatcher.Resolved, Advice.Dispatcher.SuppressionHandler, Advice.Dispatcher.Unresolved
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher.Resolved
Advice.Dispatcher.Resolved.AbstractBase, Advice.Dispatcher.Resolved.ForMethodEnter, Advice.Dispatcher.Resolved.ForMethodExit
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Field Summary
-
Fields inherited from interface net.bytebuddy.asm.Advice.Dispatcher
IGNORE_ANNOTATION, IGNORE_METHOD
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Inactive()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply()
Applies this dispatcher.Advice.Dispatcher.Resolved.ForMethodEnter
asMethodEnter(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodExit, Advice.PostProcessor.Factory postProcessorFactory)
Resolves this dispatcher as a dispatcher for entering a method.Advice.Dispatcher.Resolved.ForMethodExit
asMethodExit(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodEnter, Advice.PostProcessor.Factory postProcessorFactory)
Resolves this dispatcher as a dispatcher for exiting a method.Advice.Dispatcher.Bound
bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.ArgumentHandler.ForInstrumentedMethod argumentHandler, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler, Advice.Dispatcher.RelocationHandler.Relocation relocation)
Binds this dispatcher for resolution to a specific method.TypeDescription
getAdviceType()
The type that is produced as a result of executing this advice method.Advice.ArgumentHandler.Factory
getArgumentHandlerFactory()
Returns a factory for creating anAdvice.ArgumentHandler
.java.util.Map<java.lang.String,TypeDefinition>
getNamedTypes()
Returns the named types declared by this enter advice.TypeDescription
getThrowable()
Returns the type of throwable for which this exit advice is supposed to be invoked.void
initialize()
Initialized the advice's methods local variables.boolean
isAlive()
Returnstrue
if this dispatcher is alive.boolean
isBinary()
Indicates that this dispatcher requires access to the class file declaring the advice method.boolean
isPrependLineNumber()
Returnstrue
if the first discovered line number information should be prepended to the advice code.void
prepare()
Prepares the advice method's exception handlers.static Advice.Dispatcher.Inactive
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Advice.Dispatcher.Inactive[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final Advice.Dispatcher.Inactive INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static Advice.Dispatcher.Inactive[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Advice.Dispatcher.Inactive c : Advice.Dispatcher.Inactive.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Advice.Dispatcher.Inactive valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isAlive
public boolean isAlive()
Returnstrue
if this dispatcher is alive.- Specified by:
isAlive
in interfaceAdvice.Dispatcher
- Returns:
true
if this dispatcher is alive.
-
isBinary
public boolean isBinary()
Indicates that this dispatcher requires access to the class file declaring the advice method.- Specified by:
isBinary
in interfaceAdvice.Dispatcher.Unresolved
- Returns:
true
if this dispatcher requires access to the advice method's class file.
-
getAdviceType
public TypeDescription getAdviceType()
The type that is produced as a result of executing this advice method.- Specified by:
getAdviceType
in interfaceAdvice.Dispatcher
- Returns:
- A description of the type that is produced by this advice method.
-
isPrependLineNumber
public boolean isPrependLineNumber()
Returnstrue
if the first discovered line number information should be prepended to the advice code.- Specified by:
isPrependLineNumber
in interfaceAdvice.Dispatcher.Resolved.ForMethodEnter
- Returns:
true
if the first discovered line number information should be prepended to the advice code.
-
getNamedTypes
public java.util.Map<java.lang.String,TypeDefinition> getNamedTypes()
Returns the named types declared by this enter advice.- Specified by:
getNamedTypes
in interfaceAdvice.Dispatcher.Resolved.ForMethodEnter
- Specified by:
getNamedTypes
in interfaceAdvice.Dispatcher.Unresolved
- Returns:
- The named types declared by this enter advice.
-
getThrowable
public TypeDescription getThrowable()
Returns the type of throwable for which this exit advice is supposed to be invoked.- Specified by:
getThrowable
in interfaceAdvice.Dispatcher.Resolved.ForMethodExit
- Returns:
- The
Throwable
type for which to invoke this exit advice or a description ofAdvice.NoExceptionHandler
if this exit advice does not expect to be invoked upon any throwable.
-
getArgumentHandlerFactory
public Advice.ArgumentHandler.Factory getArgumentHandlerFactory()
Returns a factory for creating anAdvice.ArgumentHandler
.- Specified by:
getArgumentHandlerFactory
in interfaceAdvice.Dispatcher.Resolved.ForMethodExit
- Returns:
- A factory for creating an
Advice.ArgumentHandler
.
-
asMethodEnter
public Advice.Dispatcher.Resolved.ForMethodEnter asMethodEnter(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodExit, Advice.PostProcessor.Factory postProcessorFactory)
Resolves this dispatcher as a dispatcher for entering a method.- Specified by:
asMethodEnter
in interfaceAdvice.Dispatcher.Unresolved
- Parameters:
userFactories
- A list of custom factories for binding parameters of an advice method.classReader
- A class reader to query for a class file which might benull
if this dispatcher is not binary.methodExit
- The unresolved dispatcher for the method exit advice.postProcessorFactory
- The post processor factory to use.- Returns:
- This dispatcher as a dispatcher for entering a method.
-
asMethodExit
public Advice.Dispatcher.Resolved.ForMethodExit asMethodExit(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Unresolved methodEnter, Advice.PostProcessor.Factory postProcessorFactory)
Resolves this dispatcher as a dispatcher for exiting a method.- Specified by:
asMethodExit
in interfaceAdvice.Dispatcher.Unresolved
- Parameters:
userFactories
- A list of custom factories for binding parameters of an advice method.classReader
- A class reader to query for a class file which might benull
if this dispatcher is not binary.methodEnter
- The unresolved dispatcher for the method enter advice.postProcessorFactory
- The post processor factory to use.- Returns:
- This dispatcher as a dispatcher for exiting a method.
-
prepare
public void prepare()
Prepares the advice method's exception handlers.- Specified by:
prepare
in interfaceAdvice.Dispatcher.Bound
-
initialize
public void initialize()
Initialized the advice's methods local variables.- Specified by:
initialize
in interfaceAdvice.Dispatcher.Bound
-
apply
public void apply()
Applies this dispatcher.- Specified by:
apply
in interfaceAdvice.Dispatcher.Bound
-
bind
public Advice.Dispatcher.Bound bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.ArgumentHandler.ForInstrumentedMethod argumentHandler, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler, Advice.Dispatcher.RelocationHandler.Relocation relocation)
Binds this dispatcher for resolution to a specific method.- Specified by:
bind
in interfaceAdvice.Dispatcher.Resolved
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.methodVisitor
- The method visitor for writing the instrumented method.implementationContext
- The implementation context to use.assigner
- The assigner to use.argumentHandler
- A handler for accessing values on the local variable array.methodSizeHandler
- A handler for computing the method size requirements.stackMapFrameHandler
- A handler for translating and injecting stack map frames.exceptionHandler
- The stack manipulation to apply within a suppression handler.relocation
- A relocation to use with a relocation handler.- Returns:
- A dispatcher that is bound to the instrumented method.
-
-