Package net.bytebuddy.asm
Class Advice.ArgumentHandler.ForInstrumentedMethod.Default
java.lang.Object
net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod.Default
- All Implemented Interfaces:
Advice.ArgumentHandler,Advice.ArgumentHandler.ForInstrumentedMethod
- Direct Known Subclasses:
Advice.ArgumentHandler.ForInstrumentedMethod.Default.Copying,Advice.ArgumentHandler.ForInstrumentedMethod.Default.Simple
- Enclosing interface:
Advice.ArgumentHandler.ForInstrumentedMethod
public abstract static class Advice.ArgumentHandler.ForInstrumentedMethod.Default
extends Object
implements Advice.ArgumentHandler.ForInstrumentedMethod
A default implementation of an argument handler for an instrumented method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAn argument handler for an instrumented method that copies all arguments before executing the instrumented method.protected static classA simple argument handler for an instrumented method.Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler
Advice.ArgumentHandler.Factory, Advice.ArgumentHandler.ForAdvice, Advice.ArgumentHandler.ForInstrumentedMethodNested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod
Advice.ArgumentHandler.ForInstrumentedMethod.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TypeDefinitionThe enter type orvoidif no enter type is defined.protected final TypeDefinitionThe exit type orvoidif no exit type is defined.protected final MethodDescriptionThe instrumented method.protected final SortedMap<String, TypeDefinition> A mapping of all available local variables by their name to their type.Fields inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler
THIS_REFERENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault(MethodDescription instrumentedMethod, TypeDefinition exitType, SortedMap<String, TypeDefinition> namedTypes, TypeDefinition enterType) Creates a new default argument handler for an instrumented method. -
Method Summary
Modifier and TypeMethodDescriptionbindEnter(MethodDescription adviceMethod) Binds an advice method as enter advice for this handler.bindExit(MethodDescription adviceMethod, boolean skipThrowable) Binds an advice method as exit advice for this handler.intenter()Resolves the offset of the enter value of the enter advice.intexit()Resolves the offset of the exit value of the exit advice.Returns a list of the named types in their declared order.intReturns the offset of the local variable with the given name.intreturned()Resolves the offset of the returned value of the instrumented method.intthrown()Resolves the offset of the thrown exception of the instrumented method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler
argumentMethods inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod
isCopyingArguments, prepare
-
Field Details
-
instrumentedMethod
The instrumented method. -
exitType
The exit type orvoidif no exit type is defined. -
namedTypes
A mapping of all available local variables by their name to their type. -
enterType
The enter type orvoidif no enter type is defined.
-
-
Constructor Details
-
Default
protected Default(MethodDescription instrumentedMethod, TypeDefinition exitType, SortedMap<String, TypeDefinition> namedTypes, TypeDefinition enterType) Creates a new default argument handler for an instrumented method.- Parameters:
instrumentedMethod- The instrumented method.exitType- The exit type orvoidif no exit type is defined.namedTypes- A mapping of all available local variables by their name to their type.enterType- The enter type orvoidif no enter type is defined.
-
-
Method Details
-
exit
public int exit()Resolves the offset of the exit value of the exit advice.- Specified by:
exitin interfaceAdvice.ArgumentHandler- Returns:
- The offset of the exit value.
-
named
Returns the offset of the local variable with the given name.- Specified by:
namedin interfaceAdvice.ArgumentHandler- Parameters:
name- The name of the local variable being accessed.- Returns:
- The named variable's offset.
-
enter
public int enter()Resolves the offset of the enter value of the enter advice.- Specified by:
enterin interfaceAdvice.ArgumentHandler- Returns:
- The offset of the enter value.
-
returned
public int returned()Resolves the offset of the returned value of the instrumented method.- Specified by:
returnedin interfaceAdvice.ArgumentHandler- Returns:
- The offset of the returned value of the instrumented method.
-
thrown
public int thrown()Resolves the offset of the thrown exception of the instrumented method.- Specified by:
thrownin interfaceAdvice.ArgumentHandler- Returns:
- The offset of the thrown exception of the instrumented method.
-
bindEnter
Binds an advice method as enter advice for this handler.- Specified by:
bindEnterin interfaceAdvice.ArgumentHandler.ForInstrumentedMethod- Parameters:
adviceMethod- The resolved enter advice handler.- Returns:
- The resolved argument handler for enter advice.
-
bindExit
public Advice.ArgumentHandler.ForAdvice bindExit(MethodDescription adviceMethod, boolean skipThrowable) Binds an advice method as exit advice for this handler.- Specified by:
bindExitin interfaceAdvice.ArgumentHandler.ForInstrumentedMethod- Parameters:
adviceMethod- The resolved exit advice handler.skipThrowable-trueif no throwable is stored.- Returns:
- The resolved argument handler for enter advice.
-
getNamedTypes
Returns a list of the named types in their declared order.- Specified by:
getNamedTypesin interfaceAdvice.ArgumentHandler.ForInstrumentedMethod- Returns:
- A list of the named types in their declared order.
-