Package net.bytebuddy.asm
Class Advice.ArgumentHandler.ForInstrumentedMethod.Copying
- java.lang.Object
-
- net.bytebuddy.asm.Advice.ArgumentHandler.ForInstrumentedMethod.Copying
-
- All Implemented Interfaces:
Advice.ArgumentHandler,Advice.ArgumentHandler.ForInstrumentedMethod
- Enclosing interface:
- Advice.ArgumentHandler.ForInstrumentedMethod
public static class Advice.ArgumentHandler.ForInstrumentedMethod.Copying extends java.lang.Object implements Advice.ArgumentHandler.ForInstrumentedMethod
An argument handler for an instrumented method that copies all arguments before executing the 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 protectedCopying(MethodDescription instrumentedMethod, TypeDefinition enterType)Creates a new argument-copying argument handler for an instrumented method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intargument(int offset)Resolves an offset relative to an offset of the instrumented method.Advice.ArgumentHandler.ForAdvicebindEnter(MethodDescription adviceMethod)Binds an advice method as enter advice for this handler.Advice.ArgumentHandler.ForAdvicebindExit(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.booleanisCopyingArguments()Returnstrueif the original arguments are copied before invoking the instrumented method.intprepare(org.objectweb.asm.MethodVisitor methodVisitor)Prepates this argument handler for future offset access.intreturned()Resolves the offset of the returned value of the instrumented method.intthrown()Resolves the offset of the thrown exception of the instrumented method.intvariable(int index)Resolves a local variable index.
-
-
-
Constructor Detail
-
Copying
protected Copying(MethodDescription instrumentedMethod, TypeDefinition enterType)
Creates a new argument-copying argument handler for an instrumented method.- Parameters:
instrumentedMethod- The instrumented method.enterType- The enter type orvoidif no enter type is defined.
-
-
Method Detail
-
argument
public int argument(int offset)
Description copied from interface:Advice.ArgumentHandlerResolves an offset relative to an offset of the instrumented method.- Specified by:
argumentin interfaceAdvice.ArgumentHandler- Parameters:
offset- The offset to resolve.- Returns:
- The resolved offset.
-
enter
public int enter()
Description copied from interface:Advice.ArgumentHandlerResolves 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()
Description copied from interface:Advice.ArgumentHandlerResolves 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()
Description copied from interface:Advice.ArgumentHandlerResolves 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.
-
variable
public int variable(int index)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethodResolves a local variable index.- Specified by:
variablein 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.ForInstrumentedMethodPrepates this argument handler for future offset access.- Specified by:
preparein 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.ForInstrumentedMethodBinds 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)
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethodBinds 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.
-
isCopyingArguments
public boolean isCopyingArguments()
Description copied from interface:Advice.ArgumentHandler.ForInstrumentedMethodReturnstrueif the original arguments are copied before invoking the instrumented method.- Specified by:
isCopyingArgumentsin interfaceAdvice.ArgumentHandler.ForInstrumentedMethod- Returns:
trueif the original arguments are copied before invoking the instrumented method.
-
-