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
A post processor implementation of
Advice.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
FieldsModifier and TypeFieldDescriptionprivate final List
<Advice.AssignReturned.Handler> The list of handlers to apply.Fields inherited from class net.bytebuddy.asm.Advice.AssignReturned
exceptionHandlerFactory, exit, NO_INDEX, skipOnDefaultValue, type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForScalar
(TypeDescription.Generic type, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, boolean skipOnDefaultValue, Collection<List<Advice.AssignReturned.Handler>> handlers) Creates a post processor to assign a returned scalar value. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<Advice.AssignReturned.Handler> 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 Details
-
handlers
The list of handlers to apply.
-
-
Constructor Details
-
ForScalar
protected ForScalar(TypeDescription.Generic type, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, boolean skipOnDefaultValue, Collection<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 Details
-
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
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
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.
-