Class AnnotationSynthesizers
java.lang.Object
org.springframework.security.core.annotation.AnnotationSynthesizers
Factory for creating
AnnotationSynthesizer
instances.- Since:
- 6.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
AnnotationSynthesizer<A>requireUnique
(Class<A> type) Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
.static <A extends Annotation>
AnnotationSynthesizer<A>requireUnique
(Class<A> type, AnnotationTemplateExpressionDefaults templateDefaults) Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
.static AnnotationSynthesizer<Annotation>
requireUnique
(List<Class<? extends Annotation>> types) Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
.
-
Method Details
-
requireUnique
Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
.- Type Parameters:
A
- the annotation type- Parameters:
type
- the annotation type- Returns:
- the default
AnnotationSynthesizer
-
requireUnique
public static <A extends Annotation> AnnotationSynthesizer<A> requireUnique(Class<A> type, AnnotationTemplateExpressionDefaults templateDefaults) Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
.When a
AnnotationTemplateExpressionDefaults
is provided, it will return a synthesizer that supports placeholders in the annotation's attributes in addition to the meta-annotation synthesizing provided byrequireUnique(Class)
.- Type Parameters:
A
- the annotation type- Parameters:
type
- the annotation typetemplateDefaults
- the defaults for resolving placeholders in the annotation's attributes- Returns:
- the default
AnnotationSynthesizer
-
requireUnique
public static AnnotationSynthesizer<Annotation> requireUnique(List<Class<? extends Annotation>> types) Create aAnnotationSynthesizer
that requires synthesized annotations to be unique on the givenAnnotatedElement
. Supplying multiple types implies that the synthesized annotation must be unique across all specified types.- Parameters:
types
- the annotation types- Returns:
- the default
AnnotationSynthesizer
-