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:
BeanDefinitionProcessor<A>
- Direct Known Subclasses:
DefaultHttpClientFilterResolver
@Internal
public abstract class BaseFilterProcessor<A extends Annotation>
extends Object
implements BeanDefinitionProcessor<A>
Base class for processing
ServerFilter and
ClientFilter beans.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface that signals toFilterRunnerthat we should wait for the request body to arrive before running this binder.protected static final record -
Constructor Summary
ConstructorsConstructorDescriptionBaseFilterProcessor(@Nullable BeanContext beanContext, Class<A> filterAnnotation) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddFilter(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Add a filter.prependContextPath(@NonNull List<String> patterns) Prepend server context path if necessary.final voidprocess(BeanDefinition<?> beanDefinition, BeanContext beanContext) The process method will be called for every bean annotated with the given annotation type.
-
Constructor Details
-
BaseFilterProcessor
-
-
Method Details
-
process
Description copied from interface:BeanDefinitionProcessorThe process method will be called for every bean annotated with the given annotation type.- Specified by:
processin interfaceBeanDefinitionProcessor<A extends Annotation>- Parameters:
beanDefinition- The bean definitionbeanContext- The bean context
-
addFilter
protected abstract void addFilter(Supplier<GenericHttpFilter> factory, AnnotationMetadata methodAnnotations, BaseFilterProcessor.FilterMetadata metadata) Add a filter.- Parameters:
factory- Factory that will create the filter instancemethodAnnotations- Annotations on the filter methodmetadata- Filter metadata from class and method annotations
-
prependContextPath
Prepend server context path if necessary.- Parameters:
patterns- Input patterns- Returns:
- Output patterns with server context path prepended
-