Class JSentinelAnnotationScanner
java.lang.Object
com.svenruppert.jsentinel.authorization.impl.JSentinelAnnotationScanner
Scans annotated elements for
JSentinelAnnotation-meta-annotated
restriction annotations and resolves the corresponding evaluator class.
Results are cached per class. This class is Vaadin-free and can be unit-tested independently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionScans the given class for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.scan(AnnotatedElement element) Scans the given annotated element for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.Scans the given method for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.
-
Constructor Details
-
JSentinelAnnotationScanner
public JSentinelAnnotationScanner()Creates a new scanner with an empty cache.
-
-
Method Details
-
scan
Scans the given class for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.- Parameters:
navigationTarget- the class to scan- Returns:
- the pair, or empty if no restriction annotation is present
- Throws:
IllegalStateException- if more than one restriction annotation is found
-
scan
Scans the given method for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.- Parameters:
method- the method to scan- Returns:
- the pair, or empty if no restriction annotation is present
- Throws:
IllegalStateException- if more than one restriction annotation is found
-
scan
Scans the given annotated element for a restriction annotation and returns the annotation together with the evaluator class declared viaJSentinelAnnotation.- Parameters:
element- the annotated element to scan- Returns:
- the pair, or empty if no restriction annotation is present
- Throws:
IllegalStateException- if more than one restriction annotation is found
-