Interface Annotated

All Known Implementing Classes:
ClassMember, JClass, JField, JMethod

public interface Annotated
Represents objects that can be attached annotations.

Currently, only JClass, JMethod, and JField implements this interface. Besides, annotations on parameters are supported, and they are stored in JMethod instead of parameters in IR.

TODO: let other program elements (e.g., Var implements this interface.

  • Method Details

    • hasAnnotation

      boolean hasAnnotation(String annotationType)
      Returns:
      true if this annotated object has an annotation of annotationType.
    • getAnnotation

      @Nullable Annotation getAnnotation(String annotationType)
      Returns:
      the Annotation of type annotationType if it is present in this annotated; otherwise, null is returned.
    • getAnnotations

      Collection<Annotation> getAnnotations()
      Returns:
      all annotations in this annotated object.