Search in sources :

Example 1 with DefaultAnnotationFormatter

use of org.checkerframework.framework.util.DefaultAnnotationFormatter in project checker-framework by typetools.

the class AnnotationUtils method toStringSimple.

/**
 * Returns a string representation of the annotation mirrors, using simple (not fully-qualified)
 * names.
 *
 * @param annos annotations to format
 * @return the string representation, using simple (not fully-qualified) names
 */
@SideEffectFree
public static String toStringSimple(Set<AnnotationMirror> annos) {
    DefaultAnnotationFormatter defaultAnnotationFormatter = new DefaultAnnotationFormatter();
    StringJoiner result = new StringJoiner(" ");
    for (AnnotationMirror am : annos) {
        result.add(defaultAnnotationFormatter.formatAnnotationMirror(am));
    }
    return result.toString();
}
Also used : CheckerFrameworkAnnotationMirror(org.checkerframework.javacutil.AnnotationBuilder.CheckerFrameworkAnnotationMirror) AnnotationMirror(javax.lang.model.element.AnnotationMirror) DefaultAnnotationFormatter(org.checkerframework.framework.util.DefaultAnnotationFormatter) StringJoiner(java.util.StringJoiner) SideEffectFree(org.checkerframework.dataflow.qual.SideEffectFree)

Aggregations

StringJoiner (java.util.StringJoiner)1 AnnotationMirror (javax.lang.model.element.AnnotationMirror)1 SideEffectFree (org.checkerframework.dataflow.qual.SideEffectFree)1 DefaultAnnotationFormatter (org.checkerframework.framework.util.DefaultAnnotationFormatter)1 CheckerFrameworkAnnotationMirror (org.checkerframework.javacutil.AnnotationBuilder.CheckerFrameworkAnnotationMirror)1