framework.src.org.checkerframework.qualframework.poly.format.SurfaceSyntaxFormatterConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
The Checker Framework enhances Java’s type system to
make it more powerful and useful. This lets software developers
detect and prevent errors in their Java programs.
The Checker Framework includes compiler plug-ins ("checkers")
that find bugs or verify their absence. It also permits you to
write your own compiler plug-ins.
package org.checkerframework.qualframework.poly.format;
import org.checkerframework.qualframework.poly.QualParams;
import org.checkerframework.qualframework.poly.format.SurfaceSyntaxQualParamsFormatter.AnnotationParts;
/**
* SurfaceSyntaxFormatterConfiguration provides values and methods required by
* the SurfaceSyntaxQualParamsFormatter to format a QualParams into an annotation.
*/
public abstract class SurfaceSyntaxFormatterConfiguration {
/** The top ground qualifier **/
private Q top;
/** The bottom ground qualifier **/
private Q bottom;
/** The top qualifier in the QualParams hierarchy **/
private QualParams qualTop;
/** The bottom ground qualifier **/
private QualParams qualBottom;
public SurfaceSyntaxFormatterConfiguration(Q top, Q bottom, QualParams qualTop, QualParams qualBottom) {
this.top = top;
this.bottom = bottom;
this.qualTop = qualTop;
this.qualBottom = qualBottom;
}
/**
* Determine if the annotation should be printed
*
* @param anno the AnnotationParts representation of the annotatino
* @param printInvisibleQualifiers if printingInvisibleQualifiers is enabled
* @return true if the annotation should be printed
*/
protected abstract boolean shouldPrintAnnotation(AnnotationParts anno, boolean printInvisibleQualifiers);
/**
* Return an AnnotationParts object that represents the equivalent
* annotation of q.
*
* @param qual the qualifier
* @return the AnnotationParts
*/
protected abstract AnnotationParts getTargetTypeSystemAnnotation(Q qual);
public Q getBottom() {
return bottom;
}
public Q getTop() {
return top;
}
public QualParams getQualBottom() {
return qualBottom;
}
public QualParams getQualTop() {
return qualTop;
}
}