Class DefaultAnnotationFormatter
- java.lang.Object
-
- org.checkerframework.framework.util.DefaultAnnotationFormatter
-
- All Implemented Interfaces:
AnnotationFormatter
- Direct Known Subclasses:
UnitsAnnotatedTypeFormatter.UnitsAnnotationFormatter
public class DefaultAnnotationFormatter extends java.lang.Object implements AnnotationFormatter
A utility for converting AnnotationMirrors to Strings. It omits full package names.
-
-
Constructor Summary
Constructors Constructor Description DefaultAnnotationFormatter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
formatAnnotationMirror(javax.lang.model.element.AnnotationMirror anno)
Returns the string representation of a single AnnotationMirror, without showing full package names.java.lang.String
formatAnnotationString(java.util.Collection<? extends javax.lang.model.element.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.static boolean
isInvisibleQualified(javax.lang.model.element.AnnotationMirror anno)
Returns true if, by default, anno should not be printed.
-
-
-
Method Detail
-
isInvisibleQualified
public static boolean isInvisibleQualified(javax.lang.model.element.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:
InvisibleQualifier
-
formatAnnotationString
@SideEffectFree public java.lang.String formatAnnotationString(java.util.Collection<? extends javax.lang.model.element.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 interfaceAnnotationFormatter
- Parameters:
annos
- a collection of annotations to printprintInvisible
- whether or not to print "invisible" annotation mirrors- Returns:
- the list of annotations converted to a String
- See Also:
InvisibleQualifier
-
formatAnnotationMirror
@SideEffectFree public java.lang.String formatAnnotationMirror(javax.lang.model.element.AnnotationMirror anno)
Returns the string representation of a single AnnotationMirror, without showing full package names.- Specified by:
formatAnnotationMirror
in interfaceAnnotationFormatter
- Parameters:
anno
- the annotation mirror to convert- Returns:
- the string representation of a single AnnotationMirror, without showing full package names
-
-