Class Annotation

java.lang.Object
pascal.taie.language.annotation.Annotation
All Implemented Interfaces:
Serializable

public class Annotation extends Object implements Serializable
Represents annotations in the program. Each annotation contains 0 or more named elements.

Currently, we use String (instead of JClass or ClassType) to represent the type of an annotation. This makes it easier for the frontends to extract annotations from the program (The type string is ready in the program, and the frontends do not need to resolve the string to JClass).

TODO: add ElementType and RetentionPolicy.

See Also:
  • Constructor Details

  • Method Details

    • getType

      public String getType()
    • hasElement

      public boolean hasElement(String name)
    • getElement

      @Nullable public Element getElement(String name)
    • getElementEntries

      public Set<Annotation.Entry> getElementEntries()
      Returns:
      all name-element entries in this annotation.
    • toString

      public String toString()
      Overrides:
      toString in class Object