Class LiteralTreeAnnotator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected QualifierHierarchy qualHierarchy
      The qualifier hierarchy.
      • Fields inherited from class com.sun.source.util.SimpleTreeVisitor

        DEFAULT_VALUE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLiteralKind​(LiteralKind literalKind, javax.lang.model.element.AnnotationMirror theQual)
      Added a rule for a particular LiteralKind
      LiteralTreeAnnotator addStandardLiteralQualifiers()
      Adds standard qualifiers for literals.
      void addStringPattern​(java.lang.String pattern, javax.lang.model.element.AnnotationMirror theQual)
      Added a rule for all String literals that match the given pattern.
      java.lang.Void defaultAction​(com.sun.source.tree.Tree tree, AnnotatedTypeMirror type)  
      java.lang.Void visitLiteral​(com.sun.source.tree.LiteralTree tree, AnnotatedTypeMirror type)
      Go through the string patterns and add the greatest lower bound of all matching patterns.
      • Methods inherited from class com.sun.source.util.SimpleTreeVisitor

        visit, visit, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitMemberReference, visitMemberSelect, visitMethodInvocation, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • qualHierarchy

        protected final QualifierHierarchy qualHierarchy
        The qualifier hierarchy.
    • Constructor Detail

      • LiteralTreeAnnotator

        public LiteralTreeAnnotator​(AnnotatedTypeFactory atypeFactory)
        Creates a LiteralTreeAnnotator for the given atypeFactory.
        Parameters:
        atypeFactory - the type factory to make an annotator for
    • Method Detail

      • addLiteralKind

        public void addLiteralKind​(LiteralKind literalKind,
                                   javax.lang.model.element.AnnotationMirror theQual)
        Added a rule for a particular LiteralKind
        Parameters:
        literalKind - LiteralKind that should be defaulted to theQual
        theQual - the AnnotationMirror that should be applied to the literalKind
      • addStringPattern

        public void addStringPattern​(java.lang.String pattern,
                                     javax.lang.model.element.AnnotationMirror theQual)
        Added a rule for all String literals that match the given pattern.
        Parameters:
        pattern - pattern to match Strings against
        theQual - AnnotationMirror to apply to Strings that match the pattern
      • defaultAction

        public java.lang.Void defaultAction​(com.sun.source.tree.Tree tree,
                                            AnnotatedTypeMirror type)
        Overrides:
        defaultAction in class com.sun.source.util.SimpleTreeVisitor<java.lang.Void,​AnnotatedTypeMirror>
      • visitLiteral

        public java.lang.Void visitLiteral​(com.sun.source.tree.LiteralTree tree,
                                           AnnotatedTypeMirror type)
        Go through the string patterns and add the greatest lower bound of all matching patterns.
        Specified by:
        visitLiteral in interface com.sun.source.tree.TreeVisitor<java.lang.Void,​AnnotatedTypeMirror>
        Overrides:
        visitLiteral in class com.sun.source.util.SimpleTreeVisitor<java.lang.Void,​AnnotatedTypeMirror>