Package net.bytebuddy.asm
Class Advice.ArgumentHandler.ForAdvice.Default
- java.lang.Object
-
- net.bytebuddy.asm.Advice.ArgumentHandler.ForAdvice.Default
-
- All Implemented Interfaces:
Advice.ArgumentHandler
,Advice.ArgumentHandler.ForAdvice
- Direct Known Subclasses:
Advice.ArgumentHandler.ForAdvice.Default.ForMethodEnter
,Advice.ArgumentHandler.ForAdvice.Default.ForMethodExit
- Enclosing interface:
- Advice.ArgumentHandler.ForAdvice
public abstract static class Advice.ArgumentHandler.ForAdvice.Default extends java.lang.Object implements Advice.ArgumentHandler.ForAdvice
A default implementation for an argument handler for an advice method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Advice.ArgumentHandler.ForAdvice.Default.ForMethodEnter
An argument handler for an enter advice method.protected static class
Advice.ArgumentHandler.ForAdvice.Default.ForMethodExit
An argument handler for an exit advice 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.ForAdvice
Advice.ArgumentHandler.ForAdvice.Default
-
-
Field Summary
Fields Modifier and Type Field Description protected MethodDescription
adviceMethod
The advice method.protected TypeDefinition
exitType
The enter type orvoid
if no enter 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, MethodDescription adviceMethod, TypeDefinition exitType, java.util.TreeMap<java.lang.String,TypeDefinition> namedTypes)
Creates a new argument handler for an enter advice.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
argument(int offset)
Resolves an offset relative to an offset of the instrumented method.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.int
named(java.lang.String name)
Returns the offset of the local variable with the given name.-
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
returned, thrown
-
Methods inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler.ForAdvice
mapped
-
-
-
-
Field Detail
-
instrumentedMethod
protected final MethodDescription instrumentedMethod
The instrumented method.
-
adviceMethod
protected final MethodDescription adviceMethod
The advice method.
-
exitType
protected final TypeDefinition exitType
The enter type orvoid
if no enter 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.
-
-
Constructor Detail
-
Default
protected Default(MethodDescription instrumentedMethod, MethodDescription adviceMethod, TypeDefinition exitType, java.util.TreeMap<java.lang.String,TypeDefinition> namedTypes)
Creates a new argument handler for an enter advice.- Parameters:
instrumentedMethod
- The instrumented method.adviceMethod
- The advice 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.
-
-
Method Detail
-
argument
public int argument(int offset)
Resolves an offset relative to an offset of the instrumented method.- Specified by:
argument
in interfaceAdvice.ArgumentHandler
- Parameters:
offset
- The offset to resolve.- Returns:
- The resolved offset.
-
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.
-
-