Class RouteAccessContext
java.lang.Object
de.codecamp.vaadin.security.spring.access.route.RouteAccessContext
- All Implemented Interfaces:
AccessContext
An
AccessContext encapsulating an access attempt to a route.-
Nested Class Summary
Nested classes/interfaces inherited from interface de.codecamp.vaadin.security.spring.access.AccessContext
AccessContext.TargetType -
Constructor Summary
ConstructorsConstructorDescriptionRouteAccessContext(Class<?> targetOrLayout) Creates a newRouteAccessContext. -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
Optional<A>findAnnotation(Class<?> targetOrLayout, Class<A> annotationType) Tries to find the first matching annotation of the given type on the navigation target or layout class.<A extends Annotation>
Optional<A>findAnnotation(Class<A> annotationType) A convenience method that allows to find the first matching annotation of a certain type, looking in locations and in an order that makes the most sense for the target type of this access context.Class<?>Returns the navigation target itself or one of its parent layouts currently being checked for access.The type of the target for which to check access; either a route or and endpoint.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.codecamp.vaadin.security.spring.access.AccessContext
asEndpointAccessContext, asRouteAccessContext, isEndpoint, isRoute
-
Constructor Details
-
RouteAccessContext
Creates a newRouteAccessContext.- Parameters:
targetOrLayout- the target or parent layout class currently being checked for access
-
-
Method Details
-
getTargetType
Description copied from interface:AccessContextThe type of the target for which to check access; either a route or and endpoint.- Specified by:
getTargetTypein interfaceAccessContext- Returns:
- type of the target for which to check access
-
getAccessedTargetOrLayout
Returns the navigation target itself or one of its parent layouts currently being checked for access.- Returns:
- the target or parent layout class currently being checked for access
-
findAnnotation
Description copied from interface:AccessContextA convenience method that allows to find the first matching annotation of a certain type, looking in locations and in an order that makes the most sense for the target type of this access context. This method does support meta-annotations.- Specified by:
findAnnotationin interfaceAccessContext- Type Parameters:
A- the annotation type- Parameters:
annotationType- the annotation type- Returns:
- the first matching annotation
-
findAnnotation
public <A extends Annotation> Optional<A> findAnnotation(Class<?> targetOrLayout, Class<A> annotationType) Tries to find the first matching annotation of the given type on the navigation target or layout class. This method also examines superclasses and interfaces and supports meta-annotations.- Type Parameters:
A- the annotation type- Parameters:
targetOrLayout- the navigation target or layout classannotationType- the annotation type being looked for- Returns:
- the first matching annotation
-