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 java.lang.Object implements Advice.ArgumentHandler.ForInstrumentedMethod
A default implementation of an argument handler for an instrumented method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Advice.ArgumentHandler.ForInstrumentedMethod.Default.Copying
An argument handler for an instrumented method that copies all arguments before executing the instrumented method.protected static class
Advice.ArgumentHandler.ForInstrumentedMethod.Default.Simple
A 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.ForInstrumentedMethod
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod
Advice.ArgumentHandler.ForInstrumentedMethod.Default
-
-
Field Summary
Fields Modifier and Type Field Description protected TypeDefinition
enterType
The enter type orvoid
if no enter type is defined.protected TypeDefinition
exitType
The exit type orvoid
if no exit type is defined.protected MethodDescription
instrumentedMethod
The instrumented method.protected java.util.TreeMap<java.lang.String,TypeDefinition>
namedTypes
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
Constructors Modifier Constructor Description protected
Default(MethodDescription instrumentedMethod, TypeDefinition exitType, java.util.TreeMap<java.lang.String,TypeDefinition> namedTypes, TypeDefinition enterType)
Creates a new default argument handler for an instrumented method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Advice.ArgumentHandler.ForAdvice
bindEnter(MethodDescription adviceMethod)
Binds an advice method as enter advice for this handler.Advice.ArgumentHandler.ForAdvice
bindExit(MethodDescription adviceMethod, boolean skipThrowable)
Binds an advice method as exit advice for this handler.int
enter()
Resolves the offset of the enter value of the enter advice.int
exit()
Resolves the offset of the exit value of the exit advice.java.util.List<TypeDescription>
getNamedTypes()
Returns a list of the named types in their declared order.int
named(java.lang.String name)
Returns the offset of the local variable with the given name.int
returned()
Resolves the offset of the returned value of the instrumented method.int
thrown()
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, wait
-
Methods inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler
argument
-
Methods inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod
isCopyingArguments, prepare, variable
-
-
-
-
Field Detail
-
instrumentedMethod
protected final MethodDescription instrumentedMethod
The instrumented method.
-
exitType
protected final TypeDefinition exitType
The exit type orvoid
if no exit type is defined.
-
namedTypes
protected final java.util.TreeMap<java.lang.String,TypeDefinition> namedTypes
A mapping of all available local variables by their name to their type.
-
enterType
protected final TypeDefinition enterType
The enter type orvoid
if no enter type is defined.
-
-
Constructor Detail
-
Default
protected Default(MethodDescription instrumentedMethod, TypeDefinition exitType, java.util.TreeMap<java.lang.String,TypeDefinition> namedTypes, TypeDefinition enterType)
Creates a new default argument handler for an instrumented method.- Parameters:
instrumentedMethod
- The instrumented method.exitType
- The exit type orvoid
if no exit type is defined.namedTypes
- A mapping of all available local variables by their name to their type.enterType
- The enter type orvoid
if no enter type is defined.
-
-
Method Detail
-
exit
public int exit()
Resolves the offset of the exit value of the exit advice.- Specified by:
exit
in interfaceAdvice.ArgumentHandler
- Returns:
- The offset of the exit value.
-
named
public int named(java.lang.String name)
Returns the offset of the local variable with the given name.- Specified by:
named
in 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:
enter
in 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:
returned
in 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:
thrown
in interfaceAdvice.ArgumentHandler
- Returns:
- The offset of the thrown exception of the instrumented method.
-
bindEnter
public Advice.ArgumentHandler.ForAdvice bindEnter(MethodDescription adviceMethod)
Binds an advice method as enter advice for this handler.- Specified by:
bindEnter
in 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:
bindExit
in interfaceAdvice.ArgumentHandler.ForInstrumentedMethod
- Parameters:
adviceMethod
- The resolved exit advice handler.skipThrowable
-true
if no throwable is stored.- Returns:
- The resolved argument handler for enter advice.
-
getNamedTypes
public java.util.List<TypeDescription> getNamedTypes()
Returns a list of the named types in their declared order.- Specified by:
getNamedTypes
in interfaceAdvice.ArgumentHandler.ForInstrumentedMethod
- Returns:
- A list of the named types in their declared order.
-
-