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 INSTANCEThe singleton instance.
-
Field Summary
-
Fields inherited from interface net.bytebuddy.asm.Advice.Dispatcher
IGNORE_ANNOTATION, IGNORE_METHOD
-
-
Constructor Summary
Constructors Modifier Constructor Description privateInactive()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()Applies this dispatcher.Advice.Dispatcher.Resolved.ForMethodEnterasMethodEnter(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, AsmClassReader classReader, Advice.Dispatcher.Unresolved methodExit, Advice.PostProcessor.Factory postProcessorFactory)Resolves this dispatcher as a dispatcher for entering a method.Advice.Dispatcher.Resolved.ForMethodExitasMethodExit(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, AsmClassReader classReader, Advice.Dispatcher.Unresolved methodEnter, Advice.PostProcessor.Factory postProcessorFactory)Resolves this dispatcher as a dispatcher for exiting a method.Advice.Dispatcher.Boundbind(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.TypeDefinitiongetActualAdviceType()Returns the actual advice type, even if it is not required post advice processing.TypeDescriptiongetAdviceType()The type that is produced as a result of executing this advice method.Advice.ArgumentHandler.FactorygetArgumentHandlerFactory()Returns a factory for creating anAdvice.ArgumentHandler.java.util.Map<java.lang.String,TypeDefinition>getNamedTypes()Returns the named types declared by this enter advice.TypeDescriptiongetThrowable()Returns the type of throwable for which this exit advice is supposed to be invoked.voidinitialize()Initialized 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.booleanisPrependLineNumber()Returnstrueif the first discovered line number information should be prepended to the advice code.voidprepare()Prepares the advice method's exception handlers.static Advice.Dispatcher.InactivevalueOf(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()
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
public TypeDescription 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
public TypeDefinition 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
public java.util.Map<java.lang.String,TypeDefinition> 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
public TypeDescription 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
public Advice.ArgumentHandler.Factory 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(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull AsmClassReader 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(java.util.List<? extends Advice.OffsetMapping.Factory<?>> userFactories, @MaybeNull AsmClassReader 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.
-
-