Class DefaultAnnotationFormatter

java.lang.Object
org.checkerframework.framework.util.DefaultAnnotationFormatter
All Implemented Interfaces:
AnnotationFormatter
Direct Known Subclasses:
UnitsAnnotatedTypeFormatter.UnitsAnnotationFormatter

public class DefaultAnnotationFormatter extends Object implements AnnotationFormatter
A utility for converting AnnotationMirrors to Strings. It omits full package names.
  • Constructor Details

    • DefaultAnnotationFormatter

      public DefaultAnnotationFormatter()
  • Method Details

    • isInvisibleQualified

      public static boolean isInvisibleQualified(AnnotationMirror anno)
      Returns true if, by default, anno should not be printed.
      Parameters:
      anno - the annotation mirror to test
      Returns:
      true if anno's declaration was qualified by InvisibleQualifier
      See Also:
    • formatAnnotationString

      @SideEffectFree public String formatAnnotationString(Collection<? extends AnnotationMirror> annos, boolean printInvisible)
      Creates a String of each annotation in annos separated by a single space character and terminated by a space character, obeying the printInvisible parameter.
      Specified by:
      formatAnnotationString in interface AnnotationFormatter
      Parameters:
      annos - a collection of annotations to print
      printInvisible - whether or not to print "invisible" annotation mirrors
      Returns:
      the list of annotations converted to a String
      See Also:
    • formatAnnotationMirror

      @SideEffectFree public String formatAnnotationMirror(AnnotationMirror anno)
      Returns the string representation of a single AnnotationMirror, without showing full package names.
      Specified by:
      formatAnnotationMirror in interface AnnotationFormatter
      Parameters:
      anno - the annotation mirror to convert
      Returns:
      the string representation of a single AnnotationMirror, without showing full package names