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.AssignReturned
that 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>
handlers
The list of handlers to apply.-
Fields inherited from class net.bytebuddy.asm.Advice.AssignReturned
exceptionHandlerFactory, exit, NO_INDEX, skipOnDefaultValue, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForScalar(TypeDescription.Generic type, 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 TypeDescription.Generic
getType()
Returns the assigned type that is handled by any handler.protected StackManipulation
toLoadInstruction(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.Generic type, 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:
type
- The type of the advice method.exceptionHandlerFactory
- The exception handler factory to use.exit
-true
if the post processor is applied to exit advice.skipOnDefaultValue
-true
if a default value indicates that no assignment should be conducted.handlers
- The handlers to apply.
-
-
Method Detail
-
getType
protected TypeDescription.Generic getType()
Description copied from class:Advice.AssignReturned
Returns the assigned type that is handled by any handler.- Specified by:
getType
in classAdvice.AssignReturned
- Returns:
- The handled type.
-
getHandlers
protected java.util.Collection<Advice.AssignReturned.Handler> getHandlers()
Description copied from class:Advice.AssignReturned
Returns a collection of all handlers to apply.- Specified by:
getHandlers
in classAdvice.AssignReturned
- Returns:
- The handlers to apply.
-
toLoadInstruction
protected StackManipulation toLoadInstruction(Advice.AssignReturned.Handler handler, int offset)
Description copied from class:Advice.AssignReturned
Creates a load instruction for the given handler.- Specified by:
toLoadInstruction
in 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.
-
-