Package net.bytebuddy.asm
Enum Class Advice.Dispatcher.Inactive
- All Implemented Interfaces:
Serializable,Comparable<Advice.Dispatcher.Inactive>,Constable,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 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 class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>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.UnresolvedNested 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 -
Field Summary
Fields inherited from interface net.bytebuddy.asm.Advice.Dispatcher
IGNORE_ANNOTATION, IGNORE_METHOD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Applies this dispatcher.asMethodEnter(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.asMethodExit(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.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.Returns the actual advice type, even if it is not required post advice processing.The type that is produced as a result of executing this advice method.Returns a factory for creating anAdvice.ArgumentHandler.Returns the named types declared by this enter advice.Returns the type of throwable for which this exit advice is supposed to be invoked.voidInitialized the advice's methods local variables.booleanisAlive()Returnstrueif this dispatcher is alive.booleanisBinary()Indicates that this dispatcher requires access to the class file declaring the advice method.booleanReturnstrueif the first discovered line number information should be prepended to the advice code.voidprepare()Prepares the advice method's exception handlers.static Advice.Dispatcher.InactiveReturns the enum constant of this class with the specified name.static Advice.Dispatcher.Inactive[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
Inactive
private Inactive()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isAlive
public boolean isAlive()Returnstrueif this dispatcher is alive.- Specified by:
isAlivein interfaceAdvice.Dispatcher- Returns:
trueif this dispatcher is alive.
-
isBinary
public boolean isBinary()Indicates that this dispatcher requires access to the class file declaring the advice method.- Specified by:
isBinaryin interfaceAdvice.Dispatcher.Unresolved- Returns:
trueif this dispatcher requires access to the advice method's class file.
-
getAdviceType
The type that is produced as a result of executing this advice method.- Specified by:
getAdviceTypein interfaceAdvice.Dispatcher- Returns:
- A description of the type that is produced by this advice method.
-
isPrependLineNumber
public boolean isPrependLineNumber()Returnstrueif the first discovered line number information should be prepended to the advice code.- Specified by:
isPrependLineNumberin interfaceAdvice.Dispatcher.Resolved.ForMethodEnter- Returns:
trueif the first discovered line number information should be prepended to the advice code.
-
getActualAdviceType
Returns the actual advice type, even if it is not required post advice processing.- Specified by:
getActualAdviceTypein interfaceAdvice.Dispatcher.Resolved.ForMethodEnter- Returns:
- The actual advice type, even if it is not required post advice processing.
-
getNamedTypes
Returns the named types declared by this enter advice.- Specified by:
getNamedTypesin interfaceAdvice.Dispatcher.Resolved- Specified by:
getNamedTypesin interfaceAdvice.Dispatcher.Unresolved- Returns:
- The named types declared by this enter advice.
-
getThrowable
Returns the type of throwable for which this exit advice is supposed to be invoked.- Specified by:
getThrowablein interfaceAdvice.Dispatcher.Resolved.ForMethodExit- Returns:
- The
Throwabletype for which to invoke this exit advice or a description ofAdvice.NoExceptionHandlerif this exit advice does not expect to be invoked upon any throwable.
-
getArgumentHandlerFactory
Returns a factory for creating anAdvice.ArgumentHandler.- Specified by:
getArgumentHandlerFactoryin interfaceAdvice.Dispatcher.Resolved.ForMethodExit- Returns:
- A factory for creating an
Advice.ArgumentHandler.
-
asMethodEnter
public Advice.Dispatcher.Resolved.ForMethodEnter asMethodEnter(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull 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:
asMethodEnterin 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 benullif 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(List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull 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:
asMethodExitin 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 benullif 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:
preparein interfaceAdvice.Dispatcher.Bound
-
initialize
public void initialize()Initialized the advice's methods local variables.- Specified by:
initializein interfaceAdvice.Dispatcher.Bound
-
apply
public void apply()Applies this dispatcher.- Specified by:
applyin 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:
bindin 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.
-