Package net.bytebuddy.asm
Class Advice.AssignReturned.Factory
- java.lang.Object
-
- net.bytebuddy.asm.Advice.AssignReturned.Factory
-
- All Implemented Interfaces:
Advice.PostProcessor.Factory
- Enclosing class:
- Advice.AssignReturned
@Enhance public static class Advice.AssignReturned.Factory extends java.lang.Object implements Advice.PostProcessor.Factory
A factory to create aAdvice.AssignReturnedpost processor. This processor is only added if the advice method does not returnvoid.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.PostProcessor.Factory
Advice.PostProcessor.Factory.Compound
-
-
Field Summary
Fields Modifier and Type Field Description private Advice.AssignReturned.ExceptionHandler.FactoryexceptionHandlerFactoryThe exception handler factory to use.private java.util.List<? extends Advice.AssignReturned.Handler.Factory<?>>factoriesThe handler factories to apply.private static MethodDescription.InDefinedShapeSKIP_ON_DEFAULT_VALUEA description of theAdvice.AssignReturned.AsScalar.skipOnDefaultValue()method.
-
Constructor Summary
Constructors Modifier Constructor Description Factory()Creates a new factory which a preresolved list of handler factories.protectedFactory(java.util.List<? extends Advice.AssignReturned.Handler.Factory<?>> factories, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory)Creates a new factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Advice.PostProcessormake(java.util.List<? extends AnnotationDescription> annotations, TypeDescription returnType, boolean exit)Creates a post processor for a given advice method.Advice.AssignReturned.Factorywith(java.lang.Class<? extends java.lang.annotation.Annotation> type, java.util.List<Advice.AssignReturned.Handler> handlers)Includes a list of handlers upon discovering an annotation of a given type.Advice.AssignReturned.Factorywith(java.lang.Class<? extends java.lang.annotation.Annotation> type, Advice.AssignReturned.Handler... handler)Includes a list of handlers upon discovering an annotation of a given type.Advice.AssignReturned.Factorywith(Advice.AssignReturned.Handler.Factory<?> factory)Includes the provided handler factory.Advice.PostProcessor.FactorywithSuppressed(java.lang.Class<? extends java.lang.Throwable> exceptionType)Configures this post processor to handle exceptions during assignment with the advice'sAdvice.ExceptionHandler.Advice.PostProcessor.FactorywithSuppressed(TypeDescription exceptionType)Configures this post processor to handle exceptions during assignment with the advice'sAdvice.ExceptionHandler.
-
-
-
Field Detail
-
SKIP_ON_DEFAULT_VALUE
private static final MethodDescription.InDefinedShape SKIP_ON_DEFAULT_VALUE
A description of theAdvice.AssignReturned.AsScalar.skipOnDefaultValue()method.
-
factories
private final java.util.List<? extends Advice.AssignReturned.Handler.Factory<?>> factories
The handler factories to apply.
-
exceptionHandlerFactory
private final Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory
The exception handler factory to use.
-
-
Constructor Detail
-
Factory
public Factory()
Creates a new factory which a preresolved list of handler factories.
-
Factory
protected Factory(java.util.List<? extends Advice.AssignReturned.Handler.Factory<?>> factories, Advice.AssignReturned.ExceptionHandler.Factory exceptionHandlerFactory)
Creates a new factory.- Parameters:
factories- The handler factories to apply.exceptionHandlerFactory- The exception handler factory to use.
-
-
Method Detail
-
with
public Advice.AssignReturned.Factory with(java.lang.Class<? extends java.lang.annotation.Annotation> type, Advice.AssignReturned.Handler... handler)
Includes a list of handlers upon discovering an annotation of a given type.- Parameters:
type- The annotation type that activates the handler factory.handler- The handlers to use upon discovery.- Returns:
- A new
Advice.AssignReturned.Factorythat includes the provided handlers.
-
with
public Advice.AssignReturned.Factory with(java.lang.Class<? extends java.lang.annotation.Annotation> type, java.util.List<Advice.AssignReturned.Handler> handlers)
Includes a list of handlers upon discovering an annotation of a given type.- Parameters:
type- The annotation type that activates the handler factory.handlers- The handlers to use upon discovery.- Returns:
- A new
Advice.AssignReturned.Factorythat includes the provided handlers.
-
with
public Advice.AssignReturned.Factory with(Advice.AssignReturned.Handler.Factory<?> factory)
Includes the provided handler factory.- Parameters:
factory- The handler factory to include.- Returns:
- new
Advice.AssignReturned.Factorythat includes the provided handler factory.
-
withSuppressed
public Advice.PostProcessor.Factory withSuppressed(java.lang.Class<? extends java.lang.Throwable> exceptionType)
Configures this post processor to handle exceptions during assignment with the advice'sAdvice.ExceptionHandler.- Parameters:
exceptionType- TheThrowabletype to handle.- Returns:
- A new assigning post processor that handles the specified exception types.
-
withSuppressed
public Advice.PostProcessor.Factory withSuppressed(TypeDescription exceptionType)
Configures this post processor to handle exceptions during assignment with the advice'sAdvice.ExceptionHandler.- Parameters:
exceptionType- TheThrowabletype to handle.- Returns:
- A new assigning post processor that handles the specified exception types.
-
make
public Advice.PostProcessor make(java.util.List<? extends AnnotationDescription> annotations, TypeDescription returnType, boolean exit)
Creates a post processor for a given advice method.- Specified by:
makein interfaceAdvice.PostProcessor.Factory- Parameters:
annotations- The annotations of the advice method.returnType- The advice method's return type that is being post-processed.exit-trueif the advice is exit advice.- Returns:
- The created post processor.
-
-