Class ElementAnnotationUtil

java.lang.Object
org.checkerframework.framework.util.element.ElementAnnotationUtil

public class ElementAnnotationUtil extends Object
Utility methods for adding the annotations that are stored in an Element to the type that represents that element (or a use of that Element). This class also contains package private methods used by the ElementAnnotationAppliers that do most of the work.
  • Constructor Details

    • ElementAnnotationUtil

      public ElementAnnotationUtil()
  • Method Details

    • applyAllElementAnnotations

      public static void applyAllElementAnnotations(List<? extends AnnotatedTypeMirror> types, List<? extends Element> elements, AnnotatedTypeFactory typeFactory)
      For each type/element pair, add all of the annotations stored in Element to type. See apply for more details.
      Parameters:
      types - the types to which we wish to apply element annotations
      elements - the elements that may contain annotations to apply. elements.size must == types.size
      typeFactory - the type factory used to create the AnnotatedTypeMirrors contained by types
    • toString

      public static String toString(com.sun.tools.javac.code.Attribute.TypeCompound tc)
      Returns the formatted representation of a Attribute.TypeCompound.
      Parameters:
      tc - a TypeCompound
      Returns:
      its string representation
    • toString

      public static String toString(Iterable<com.sun.tools.javac.code.Attribute.TypeCompound> tcs)
      Returns the formatted representation of a collection of Attribute.TypeCompounds.
      Parameters:
      tcs - a collection of TypeCompounds
      Returns:
      its string representation