Package io.micronaut.http.filter
Class BaseFilterProcessor<A extends Annotation>
java.lang.Object
io.micronaut.http.filter.BaseFilterProcessor<A>
- Type Parameters:
A
- Filter annotation type
- All Implemented Interfaces:
AnnotationProcessor<A,
,ExecutableMethod<?, ?>> ExecutableMethodProcessor<A>
- Direct Known Subclasses:
DefaultHttpClientFilterResolver
@Internal
public abstract class BaseFilterProcessor<A extends Annotation>
extends Object
implements ExecutableMethodProcessor<A>
Base class for processing
ServerFilter
and
ClientFilter
beans.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final record
static interface
Interface that signals toFilterRunner
that we should wait for the request body to arrive before running this binder. -
Constructor Summary
ConstructorDescriptionBaseFilterProcessor
(@Nullable BeanContext beanContext, Class<A> filterAnnotation) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addFilter
(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Add a filter.prependContextPath
(@NonNull List<String> patterns) Prepend server context path if necessary.void
process
(BeanDefinition<?> beanDefinition, ExecutableMethod<?, ?> method) The process method will be called for everyExecutableMethod
that is annotated with the type parameter A.
-
Constructor Details
-
BaseFilterProcessor
-
-
Method Details
-
process
Description copied from interface:ExecutableMethodProcessor
The process method will be called for everyExecutableMethod
that is annotated with the type parameter A.- Specified by:
process
in interfaceAnnotationProcessor<A extends Annotation,
ExecutableMethod<?, ?>> - Specified by:
process
in interfaceExecutableMethodProcessor<A extends Annotation>
- Parameters:
beanDefinition
- The bean definition to processmethod
- The executable method
-
addFilter
protected abstract void addFilter(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Add a filter. Called duringprocess(BeanDefinition, ExecutableMethod)
.- Parameters:
factory
- Factory that will create the filter instancemethodAnnotations
- Annotations on the filter methodmetadata
- Filter metadata from class and method annotations
-
prependContextPath
@NonNull protected @NonNull List<String> prependContextPath(@NonNull @NonNull List<String> patterns) Prepend server context path if necessary.- Parameters:
patterns
- Input patterns- Returns:
- Output patterns with server context path prepended
-