Class AccessRequirementUtil

java.lang.Object
com.vaadin.copilot.AccessRequirementUtil

public class AccessRequirementUtil extends Object
Utility class for figuring out access requirements for Java methods such as routes and browser callables.
  • Constructor Details

    • AccessRequirementUtil

      public AccessRequirementUtil()
  • Method Details

    • getAccessRequirement

      public static AccessRequirement getAccessRequirement(AnnotatedElement annotatedClassOrMethod, AnnotatedElement fallback)
      Get the access requirement for the given annotated class or method based on its annotations.
      Parameters:
      annotatedClassOrMethod - the annotated class or method
      fallback - the class or method to check if the given class has no access control annotations
      Returns:
      the access requirement for using the class or method
    • removeAccessAnnotations

      public static void removeAccessAnnotations(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass)
      Removes all access control annotations from the given class.
      Parameters:
      routeClass - the class to remove access control annotations from
    • setAccessAnnotation

      public static void setAccessAnnotation(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass, AccessRequirement accessRequirement)
      Sets the access control annotation for the given class.
      Parameters:
      routeClass - the class to set the access control annotation for
      accessRequirement - the access requirement to set
    • getAccessAnnotation

      public static Optional<AccessRequirement.Type> getAccessAnnotation(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass)