Search in sources :

Example 6 with AnnotatedTypeFactory

use of org.checkerframework.framework.type.AnnotatedTypeFactory in project checker-framework by typetools.

the class TypeOutputtingChecker method run.

/**
 * Run the test.
 *
 * @param args command-line arguments
 */
public void run(@CanonicalName String[] args) {
    ProcessingEnvironment env = JavacProcessingEnvironment.instance(new Context());
    Elements elements = env.getElementUtils();
    // TODO: Instead of using a GeneralAnnotatedTypeFactory, just use standard javac classes
    // to print explicit annotations.
    AnnotatedTypeFactory atypeFactory = new GeneralAnnotatedTypeFactory(this);
    for (String className : args) {
        TypeElement typeElt = elements.getTypeElement(className);
        printClassType(typeElt, atypeFactory);
    }
}
Also used : Context(com.sun.tools.javac.util.Context) TypeElement(javax.lang.model.element.TypeElement) GenericAnnotatedTypeFactory(org.checkerframework.framework.type.GenericAnnotatedTypeFactory) AnnotatedTypeFactory(org.checkerframework.framework.type.AnnotatedTypeFactory) Elements(javax.lang.model.util.Elements) JavacProcessingEnvironment(com.sun.tools.javac.processing.JavacProcessingEnvironment) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment)

Aggregations

AnnotatedTypeFactory (org.checkerframework.framework.type.AnnotatedTypeFactory)6 GenericAnnotatedTypeFactory (org.checkerframework.framework.type.GenericAnnotatedTypeFactory)5 AnnotationMirror (javax.lang.model.element.AnnotationMirror)3 TypeElement (javax.lang.model.element.TypeElement)3 ClassTree (com.sun.source.tree.ClassTree)2 ExpressionTree (com.sun.source.tree.ExpressionTree)2 MethodTree (com.sun.source.tree.MethodTree)2 Tree (com.sun.source.tree.Tree)2 TreePath (com.sun.source.util.TreePath)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 Element (javax.lang.model.element.Element)2 ExecutableElement (javax.lang.model.element.ExecutableElement)2 VariableElement (javax.lang.model.element.VariableElement)2 CFGLambda (org.checkerframework.dataflow.cfg.UnderlyingAST.CFGLambda)2 CFGMethod (org.checkerframework.dataflow.cfg.UnderlyingAST.CFGMethod)2 LocalVariableNode (org.checkerframework.dataflow.cfg.node.LocalVariableNode)2 AnnotatedTypeMirror (org.checkerframework.framework.type.AnnotatedTypeMirror)2 AnnotatedDeclaredType (org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType)2