Class ResourceAnnotationUtil

java.lang.Object
com.atlassian.confluence.plugins.restapi.annotations.ResourceAnnotationUtil

public class ResourceAnnotationUtil extends Object
Util class for checking if a code block is annotated
Since:
9.4.0
  • Constructor Details

    • ResourceAnnotationUtil

      public ResourceAnnotationUtil()
  • Method Details

    • isAnnotated

      public static boolean isAnnotated(@NonNull AnnotatedElement annotatedElement, @NonNull String simpleAnnotationName)

      Check if the element has the Annotation with the simple class name

      For example: if the ContentResource has the ReadOnlyAccessAllowed annotation and the "simpleAnnotationName" parameter is "ReadOnlyAccessAllowed", this method will return true

      Parameters:
      annotatedElement - the annotated element
      simpleAnnotationName - the simple annotation (class) name, e.g. "ReadOnlyAccessAllowed" or "ReadOnlyAccessBlocked"
      Returns:
      true if the element is annotated with the annotation
      Since:
      6.10.0
    • hasAnnotation

      public static boolean hasAnnotation(javax.ws.rs.container.ResourceInfo resourceInfo, String annotation)