Class RouteAccessContext

    • Constructor Detail

      • RouteAccessContext

        public RouteAccessContext​(Class<?> targetOrLayout)
        Creates a new RouteAccessContext.
        Parameters:
        targetOrLayout - the target or parent layout class currently being checked for access
    • Method Detail

      • getAccessedTargetOrLayout

        public Class<?> 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

        public <A extends AnnotationOptional<A> findAnnotation​(Class<A> annotationType)
        Description copied from interface: AccessContext
        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. This method does support meta-annotations.
        Specified by:
        findAnnotation in interface AccessContext
        Type Parameters:
        A - the annotation type
        Parameters:
        annotationType - the annotation type
        Returns:
        the first matching annotation
      • findAnnotation

        public <A extends AnnotationOptional<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 class
        annotationType - the annotation type being looked for
        Returns:
        the first matching annotation