Package net.bytebuddy.asm
Class Advice.AssignReturned.ForArray
- java.lang.Object
-
- net.bytebuddy.asm.Advice.AssignReturned
-
- net.bytebuddy.asm.Advice.AssignReturned.ForArray
-
- All Implemented Interfaces:
Advice.PostProcessor
- Enclosing class:
- Advice.AssignReturned
@Enhance protected static class Advice.AssignReturned.ForArray extends Advice.AssignReturned
A post processor implementation ofAdvice.AssignReturned
that works on the value of an array.
-
-
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.Map<Advice.AssignReturned.Handler,java.lang.Integer>
handlers
A mapping of the handlers to apply mapped to the index in the array that is returned by the advice method.-
Fields inherited from class net.bytebuddy.asm.Advice.AssignReturned
exceptionHandlerFactory, exit, NO_INDEX, skipOnDefaultValue, typeDescription
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForArray(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, java.util.Collection<java.util.List<Advice.AssignReturned.Handler>> handlers)
Creates a post processor to assign a returned array value by index.
-
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
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.Map<Advice.AssignReturned.Handler,java.lang.Integer> handlers
A mapping of the handlers to apply mapped to the index in the array that is returned by the advice method.
-
-
Constructor Detail
-
ForArray
protected ForArray(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, java.util.Collection<java.util.List<Advice.AssignReturned.Handler>> handlers)
Creates a post processor to assign a returned array value by index.- Parameters:
typeDescription
- The array type that is returned by the advice method.exceptionHandlerFactory
- The exception handler factory to use.exit
-true
if the post processor is applied to exit advice.handlers
- The handlers to apply.
-
-
Method Detail
-
getType
protected TypeDescription 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.
-
-