Package net.bytebuddy.asm
Class Advice.AssignReturned.ForScalar
- java.lang.Object
-
- net.bytebuddy.asm.Advice.AssignReturned
-
- net.bytebuddy.asm.Advice.AssignReturned.ForScalar
-
- All Implemented Interfaces:
Advice.PostProcessor
- Enclosing class:
- Advice.AssignReturned
@Enhance protected static class Advice.AssignReturned.ForScalar extends Advice.AssignReturned
A post processor implementation ofAdvice.AssignReturnedthat uses the returned value as such.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.asm.Advice.AssignReturned
Advice.AssignReturned.AsScalar, Advice.AssignReturned.DefaultValueSkip, Advice.AssignReturned.ExceptionHandler, Advice.AssignReturned.Factory, Advice.AssignReturned.ForArray, Advice.AssignReturned.ForScalar, Advice.AssignReturned.Handler, Advice.AssignReturned.ToAllArguments, Advice.AssignReturned.ToArguments, Advice.AssignReturned.ToFields, Advice.AssignReturned.ToReturned, Advice.AssignReturned.ToThis, Advice.AssignReturned.ToThrown
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.PostProcessor
Advice.PostProcessor.Compound, Advice.PostProcessor.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Advice.AssignReturned.Handler>handlersThe list of handlers to apply.-
Fields inherited from class net.bytebuddy.asm.Advice.AssignReturned
exceptionHandlerFactory, exit, NO_INDEX, skipOnDefaultValue, typeDescription
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForScalar(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, boolean skipOnDefaultValue, java.util.Collection<java.util.List<Advice.AssignReturned.Handler>> handlers)Creates a post processor to assign a returned scalar value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<Advice.AssignReturned.Handler>getHandlers()Returns a collection of all handlers to apply.protected TypeDescriptiongetType()Returns the assigned type that is handled by any handler.protected StackManipulationtoLoadInstruction(Advice.AssignReturned.Handler handler, int offset)Creates a load instruction for the given handler.-
Methods inherited from class net.bytebuddy.asm.Advice.AssignReturned
resolve
-
-
-
-
Field Detail
-
handlers
private final java.util.List<Advice.AssignReturned.Handler> handlers
The list of handlers to apply.
-
-
Constructor Detail
-
ForScalar
protected ForScalar(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, boolean skipOnDefaultValue, java.util.Collection<java.util.List<Advice.AssignReturned.Handler>> handlers)
Creates a post processor to assign a returned scalar value.- Parameters:
typeDescription- The type of the advice method.exceptionHandlerFactory- The exception handler factory to use.exit-trueif the post processor is applied to exit advice.skipOnDefaultValue-trueif a default value indicates that no assignment should be conducted.handlers- The handlers to apply.
-
-
Method Detail
-
getType
protected TypeDescription getType()
Description copied from class:Advice.AssignReturnedReturns the assigned type that is handled by any handler.- Specified by:
getTypein classAdvice.AssignReturned- Returns:
- The handled type.
-
getHandlers
protected java.util.Collection<Advice.AssignReturned.Handler> getHandlers()
Description copied from class:Advice.AssignReturnedReturns a collection of all handlers to apply.- Specified by:
getHandlersin classAdvice.AssignReturned- Returns:
- The handlers to apply.
-
toLoadInstruction
protected StackManipulation toLoadInstruction(Advice.AssignReturned.Handler handler, int offset)
Description copied from class:Advice.AssignReturnedCreates a load instruction for the given handler.- Specified by:
toLoadInstructionin classAdvice.AssignReturned- Parameters:
handler- The handler for which to apply a load instruction.offset- The offset of the value that is returned by the advice method.- Returns:
- A stack manipulation to load the handled value.
-
-