Package org.springframework.security.core.annotation

# Class SecurityAnnotationScanners

java.lang.Object
org.springframework.security.core.annotation.SecurityAnnotationScanners

public final class SecurityAnnotationScanners extends Object
Factory for creating `SecurityAnnotationScanner` instances.

Since:
  6.4

## Method Summary

Modifier and Type
Method
Description
`static <A extends Annotation>
SecurityAnnotationScanner<A>`
`requireUnique(Class<A> type)`
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`.
`static <A extends Annotation>
SecurityAnnotationScanner<A>`
`requireUnique(Class<A> type, AnnotationTemplateExpressionDefaults templateDefaults)`
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`.
`static SecurityAnnotationScanner<Annotation>`
`requireUnique(List<Class<? extends Annotation>> types)`
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### requireUnique

public static <A extends Annotation> SecurityAnnotationScanner<A> requireUnique(Class<A> type)
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`.

Type Parameters:
  `A` - the annotation type
Parameters:
  `type` - the annotation type
Returns:
  the default `SecurityAnnotationScanner`

### requireUnique

public static <A extends Annotation> SecurityAnnotationScanner<A> requireUnique(Class<A> type, AnnotationTemplateExpressionDefaults templateDefaults)
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`.

When a `AnnotationTemplateExpressionDefaults` is provided, it will return a scanner that supports placeholders in the annotation's attributes in addition to the meta-annotation synthesizing provided by `requireUnique(Class)`.

Type Parameters:
  `A` - the annotation type
Parameters:
  `type` - the annotation type
  `templateDefaults` - the defaults for resolving placeholders in the annotation's attributes
Returns:
  the default `SecurityAnnotationScanner`

### requireUnique

public static SecurityAnnotationScanner<Annotation> requireUnique(List<Class<? extends Annotation>> types)
Create a `SecurityAnnotationScanner` that requires synthesized annotations to be unique on the given `AnnotatedElement`. Supplying multiple types implies that the synthesized annotation must be unique across all specified types.

Parameters:
  `types` - the annotation types
Returns:
  the default `SecurityAnnotationScanner`