Class Annotation

java.lang.Object
edu.university.ecs.lab.common.models.ir.Node
edu.university.ecs.lab.common.models.ir.Annotation
All Implemented Interfaces:
JsonSerializable

public class Annotation extends Node
Represents an annotation in Java
  • Field Details

  • Constructor Details

    • Annotation

      public Annotation(com.github.javaparser.ast.expr.AnnotationExpr annotationExpr, String packageAndClassName)
    • Annotation

      public Annotation(String name, String packageAndClassName, HashMap<String,String> attributes)
  • Method Details

    • getContents

      public String getContents()
      Get contents of annotation object
      Returns:
      comma-delimmited list of annotation content key-value pairs
    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Returns:
      a JsonObject representing this
    • parseAttributes

      private static HashMap<String,String> parseAttributes(com.github.javaparser.ast.expr.AnnotationExpr annotationExpr)
      Map attributes from annotation expression
      Parameters:
      annotationExpr - annotation expression object to parse
      Returns:
      map of annotation attributes and their values