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.Bound.ForMethodEnter
,Advice.Dispatcher.Bound.ForMethodExit
,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.ForMethodEnter, Advice.Dispatcher.Bound.ForMethodExit
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.Resolved, Advice.Dispatcher.SuppressionHandler, Advice.Dispatcher.Unresolved
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher.Bound
Advice.Dispatcher.Bound.ForMethodEnter, Advice.Dispatcher.Bound.ForMethodExit, Advice.Dispatcher.Bound.SkipHandler
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher.Resolved
Advice.Dispatcher.Resolved.ForMethodEnter, Advice.Dispatcher.Resolved.ForMethodExit
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher.Resolved.ForMethodEnter
Advice.Dispatcher.Resolved.ForMethodEnter.SkipDispatcher
-
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply()
Applies this dispatcher.void
apply(Advice.Dispatcher.Bound.SkipHandler skipHandler)
Applies this dispatcher.Advice.Dispatcher.Resolved.ForMethodEnter
asMethodEnter(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader)
Resolves this dispatcher as a dispatcher for entering a method.Advice.Dispatcher.Resolved.ForMethodExit
asMethodExitTo(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Resolved.ForMethodEnter dispatcher)
Resolves this dispatcher as a dispatcher for exiting a method.Advice.Dispatcher.Inactive
bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Binds this dispatcher for resolution to a specific method.TypeDefinition
getEnterType()
Returns the type that this dispatcher supplies as a result of its advice or a description ofvoid
if no type is supplied as a result of the enter advice.TypeDescription
getThrowable()
Returns the type of throwable for which this exit advice is supposed to be invoked.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()
Description copied from interface:Advice.Dispatcher
Returnstrue
if this dispatcher is alive.- Specified by:
isAlive
in interfaceAdvice.Dispatcher
- Returns:
true
if this dispatcher is alive.
-
isBinary
public boolean isBinary()
Description copied from interface:Advice.Dispatcher.Unresolved
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.
-
getThrowable
public TypeDescription getThrowable()
Description copied from interface:Advice.Dispatcher.Resolved.ForMethodExit
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.
-
getEnterType
public TypeDefinition getEnterType()
Description copied from interface:Advice.Dispatcher.Resolved.ForMethodEnter
Returns the type that this dispatcher supplies as a result of its advice or a description ofvoid
if no type is supplied as a result of the enter advice.- Specified by:
getEnterType
in interfaceAdvice.Dispatcher.Resolved.ForMethodEnter
- Returns:
- The type that this dispatcher supplies as a result of its advice or a description of
void
.
-
isPrependLineNumber
public boolean isPrependLineNumber()
Description copied from interface:Advice.Dispatcher.Resolved.ForMethodEnter
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.
-
asMethodEnter
public Advice.Dispatcher.Resolved.ForMethodEnter asMethodEnter(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader)
Description copied from interface:Advice.Dispatcher.Unresolved
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.- Returns:
- This dispatcher as a dispatcher for entering a method.
-
asMethodExitTo
public Advice.Dispatcher.Resolved.ForMethodExit asMethodExitTo(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, org.objectweb.asm.ClassReader classReader, Advice.Dispatcher.Resolved.ForMethodEnter dispatcher)
Description copied from interface:Advice.Dispatcher.Unresolved
Resolves this dispatcher as a dispatcher for exiting a method.- Specified by:
asMethodExitTo
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.dispatcher
- The dispatcher for entering a method.- Returns:
- This dispatcher as a dispatcher for exiting a method.
-
prepare
public void prepare()
Description copied from interface:Advice.Dispatcher.Bound
Prepares the advice method's exception handlers.- Specified by:
prepare
in interfaceAdvice.Dispatcher.Bound
-
apply
public void apply()
Description copied from interface:Advice.Dispatcher.Bound.ForMethodExit
Applies this dispatcher.- Specified by:
apply
in interfaceAdvice.Dispatcher.Bound.ForMethodExit
-
apply
public void apply(Advice.Dispatcher.Bound.SkipHandler skipHandler)
Description copied from interface:Advice.Dispatcher.Bound.ForMethodEnter
Applies this dispatcher.- Specified by:
apply
in interfaceAdvice.Dispatcher.Bound.ForMethodEnter
- Parameters:
skipHandler
- The skip handler to use.
-
bind
public Advice.Dispatcher.Inactive bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, StackManipulation exceptionHandler)
Description copied from interface:Advice.Dispatcher.Resolved
Binds this dispatcher for resolution to a specific method.- Specified by:
bind
in interfaceAdvice.Dispatcher.Resolved
- Specified by:
bind
in interfaceAdvice.Dispatcher.Resolved.ForMethodEnter
- Specified by:
bind
in interfaceAdvice.Dispatcher.Resolved.ForMethodExit
- 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.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.- Returns:
- A dispatcher that is bound to the instrumented method.
-
-