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
A post processor implementation of
Advice.AssignReturned that works on the value of an array.-
Nested Class Summary
Nested classes/interfaces inherited from class 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.ToThrownNested classes/interfaces inherited from interface Advice.PostProcessor
Advice.PostProcessor.Compound, Advice.PostProcessor.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Advice.AssignReturned.Handler, Integer> 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 Advice.AssignReturned
exceptionHandlerFactory, exit, NO_INDEX, skipOnDefaultValue, typeDescription -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForArray(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, Collection<List<Advice.AssignReturned.Handler>> handlers) Creates a post processor to assign a returned array value by index. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Advice.AssignReturned.Handler> 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 Advice.AssignReturned
resolve
-
Field Details
-
handlers
A mapping of the handlers to apply mapped to the index in the array that is returned by the advice method.
-
-
Constructor Details
-
ForArray
protected ForArray(TypeDescription typeDescription, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory, boolean exit, Collection<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-trueif the post processor is applied to exit advice.handlers- The handlers to apply.
-
-
Method Details
-
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
Description copied from class:Advice.AssignReturnedReturns a collection of all handlers to apply.- Specified by:
getHandlersin classAdvice.AssignReturned- Returns:
- The handlers to apply.
-
toLoadInstruction
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.
-