Class DefaultAnnotatedTypeFormatter

java.lang.Object
org.checkerframework.framework.type.DefaultAnnotatedTypeFormatter
All Implemented Interfaces:
AnnotatedTypeFormatter
Direct Known Subclasses:
NullnessAnnotatedTypeFormatter, UnitsAnnotatedTypeFormatter

public class DefaultAnnotatedTypeFormatter extends Object implements AnnotatedTypeFormatter
An AnnotatedTypeFormatter used by default by all AnnotatedTypeFactory (and therefore all annotated types).
See Also:
  • Field Details

    • formattingVisitor

      protected final DefaultAnnotatedTypeFormatter.FormattingVisitor formattingVisitor
      The formatting visitor.
    • captureConversionIds

      protected static final Map<TypeVariable,Integer> captureConversionIds
      Maps from type variables to deterministic IDs. This is useful for comparing output across two runs of the Checker Framework.

      This map is necessary for deterministic and informative output. javac might print two distinct capture-converted variables as "capture#222" if the second is created after the first is garbage-collected, or if they just happen to have the same hash code based on memory layout. Such javac output is misleading because it looks like the two printed representations refer to the same variable.

      This map contains type variables that have been formatted. Therefore, the numbers may differ between Checker Framework runs if the different runs print different values (say, one of them prints more type variables than the other).

    • prevCaptureConversionId

      protected static int prevCaptureConversionId
      The last deterministic capture conversion ID that was used.
  • Constructor Details

    • DefaultAnnotatedTypeFormatter

      public DefaultAnnotatedTypeFormatter()
      Constructs a DefaultAnnotatedTypeFormatter that does not print invisible annotations by default.
    • DefaultAnnotatedTypeFormatter

      public DefaultAnnotatedTypeFormatter(boolean printVerboseGenerics, boolean defaultPrintInvisibleAnnos)
      Parameters:
      printVerboseGenerics - for type parameters, their uses, and wildcards, print more information
      defaultPrintInvisibleAnnos - whether or not this AnnotatedTypeFormatter should print invisible annotations
    • DefaultAnnotatedTypeFormatter

      public DefaultAnnotatedTypeFormatter(AnnotationFormatter formatter, boolean printVerboseGenerics, boolean defaultPrintInvisibleAnnos)
      Parameters:
      formatter - an object that converts annotation mirrors to strings
      printVerboseGenerics - for type parameters, their uses, and wildcards, print more information
      defaultPrintInvisibleAnnos - whether or not this AnnotatedTypeFormatter should print invisible annotations
    • DefaultAnnotatedTypeFormatter

      protected DefaultAnnotatedTypeFormatter(DefaultAnnotatedTypeFormatter.FormattingVisitor visitor)
      Used by subclasses and other constructors to specify the underlying implementation of this DefaultAnnotatedTypeFormatter.
  • Method Details