public final class HandlerTypePredicate extends Object implements Predicate<Class<?>>
Predicate to match request handling component types if
any of the following selectors match:
Composability methods on Predicate can be used :
Predicate<Class<?>> predicate =
HandlerTypePredicate.forAnnotation(RestController.class)
.and(HandlerTypePredicate.forBasePackage("org.example"));
| Modifier and Type | Class and Description |
|---|---|
static class |
HandlerTypePredicate.Builder
A
HandlerTypePredicate builder. |
| Modifier and Type | Method and Description |
|---|---|
static HandlerTypePredicate.Builder |
builder()
Return a builder for a
HandlerTypePredicate. |
static HandlerTypePredicate |
forAnnotation(Class<? extends Annotation>... annotations)
Match handlers annotated with a specific annotation.
|
static HandlerTypePredicate |
forAnyHandlerType()
Predicate that applies to any handlers. |
static HandlerTypePredicate |
forAssignableType(Class<?>... types)
Match handlers that are assignable to a given type.
|
static HandlerTypePredicate |
forBasePackage(String... packages)
Match handlers declared under a base package, e.g.
|
static HandlerTypePredicate |
forBasePackageClass(Class<?>... packageClasses)
Type-safe alternative to
forBasePackage(String...) to specify a
base package through a class. |
boolean |
test(Class<?> controllerType) |
public boolean test(Class<?> controllerType)
public static HandlerTypePredicate forAnyHandlerType()
Predicate that applies to any handlers.public static HandlerTypePredicate forBasePackage(String... packages)
packages - one or more base package namespublic static HandlerTypePredicate forBasePackageClass(Class<?>... packageClasses)
forBasePackage(String...) to specify a
base package through a class.packageClasses - one or more base package classespublic static HandlerTypePredicate forAssignableType(Class<?>... types)
types - one or more handler super types@SafeVarargs public static HandlerTypePredicate forAnnotation(Class<? extends Annotation>... annotations)
annotations - one or more annotations to check forpublic static HandlerTypePredicate.Builder builder()
HandlerTypePredicate.