Package com.vaadin.copilot
Class AccessRequirementUtil
java.lang.Object
com.vaadin.copilot.AccessRequirementUtil
Utility class for figuring out access requirements for Java methods such as
routes and browser callables.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<AccessRequirement.Type> getAccessAnnotation(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass) static AccessRequirementgetAccessRequirement(AnnotatedElement annotatedClassOrMethod, AnnotatedElement fallback) Get the access requirement for the given annotated class or method based on its annotations.static voidremoveAccessAnnotations(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass) Removes all access control annotations from the given class.static voidsetAccessAnnotation(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass, AccessRequirement accessRequirement) Sets the access control annotation for the given class.
-
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 methodfallback- 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 foraccessRequirement- the access requirement to set
-
getAccessAnnotation
public static Optional<AccessRequirement.Type> getAccessAnnotation(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration routeClass)
-