Package net.bytebuddy.asm
Class Advice.ArgumentHandler.ForInstrumentedMethod.Simple
- java.lang.Object
-
- net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod.Simple
-
- All Implemented Interfaces:
Advice.ArgumentHandler
,Advice.ArgumentHandler.ForInstrumentedMethod
- Enclosing interface:
- Advice.ArgumentHandler.ForInstrumentedMethod
public static class Advice.ArgumentHandler.ForInstrumentedMethod.Simple extends java.lang.Object implements Advice.ArgumentHandler.ForInstrumentedMethod
A simple argument handler for an instrumented method.
-
-
Nested Class Summary
-
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.Copying, Advice.ArgumentHandler.ForInstrumentedMethod.Simple
-
-
Field Summary
-
Fields inherited from interface net.bytebuddy.asm.Advice.ArgumentHandler
THIS_REFERENCE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Simple(MethodDescription instrumentedMethod, TypeDefinition enterType)
Creates a new simple argument handler for an instrumented method.
-
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.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.boolean
isCopyingArguments()
Returnstrue
if the original arguments are copied before invoking the instrumented method.int
prepare(org.objectweb.asm.MethodVisitor methodVisitor)
Prepates this argument handler for future offset access.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.int
variable(int index)
Resolves a local variable index.
-
-
-
Constructor Detail
-
Simple
protected Simple(MethodDescription instrumentedMethod, TypeDefinition enterType)
Creates a new simple argument handler for an instrumented method.- Parameters:
instrumentedMethod
- The instrumented method.enterType
- The enter type orvoid
if no enter type is defined.
-
-
Method Detail
-
argument
public int argument(int offset)
Description copied from interface:Advice.ArgumentHandler
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.
-
enter
public int enter()
Description copied from interface:Advice.ArgumentHandler
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()
Description copied from interface:Advice.ArgumentHandler
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()
Description copied from interface:Advice.ArgumentHandler
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.
-
variable
public int variable(int index)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethod
Resolves a local variable index.- Specified by:
variable
in interfaceAdvice.ArgumentHandler.ForInstrumentedMethod
- Parameters:
index
- The index to resolve.- Returns:
- The resolved local variable index.
-
prepare
public int prepare(org.objectweb.asm.MethodVisitor methodVisitor)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethod
Prepates this argument handler for future offset access.- Specified by:
prepare
in interfaceAdvice.ArgumentHandler.ForInstrumentedMethod
- Parameters:
methodVisitor
- The method visitor to which to write any potential byte code.- Returns:
- The minimum stack size that is required to apply this manipulation.
-
bindEnter
public Advice.ArgumentHandler.ForAdvice bindEnter(MethodDescription adviceMethod)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethod
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)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethod
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.
-
isCopyingArguments
public boolean isCopyingArguments()
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethod
Returnstrue
if the original arguments are copied before invoking the instrumented method.- Specified by:
isCopyingArguments
in interfaceAdvice.ArgumentHandler.ForInstrumentedMethod
- Returns:
true
if the original arguments are copied before invoking the instrumented method.
-
-