Class AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator

  • All Implemented Interfaces:
    com.sun.source.tree.TreeVisitor<java.lang.Void,​AnnotatedTypeMirror>
    Enclosing class:
    AccumulationAnnotatedTypeFactory

    protected class AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator
    extends TreeAnnotator
    This tree annotator implements the following rule(s):
    RRA
    If a method returns its receiver, and the receiver has an accumulation type, then the default type of the method's return value is the type of the receiver.
    • Field Summary

      • Fields inherited from class com.sun.source.util.SimpleTreeVisitor

        DEFAULT_VALUE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Void visitMethodInvocation​(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
      Implements rule RRA.
      • Methods inherited from class com.sun.source.util.SimpleTreeVisitor

        defaultAction, 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, visitLiteral, visitMemberReference, visitMemberSelect, 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
    • Constructor Detail

      • AccumulationTreeAnnotator

        public AccumulationTreeAnnotator​(AccumulationAnnotatedTypeFactory factory)
        Creates an instance of this tree annotator for the given type factory.
        Parameters:
        factory - the type factory
    • Method Detail

      • visitMethodInvocation

        public java.lang.Void visitMethodInvocation​(com.sun.source.tree.MethodInvocationTree tree,
                                                    AnnotatedTypeMirror type)
        Implements rule RRA.

        This implementation propagates types from the receiver to the return value, without change. Subclasses may override this method to also add additional properties, as appropriate.

        Specified by:
        visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<java.lang.Void,​AnnotatedTypeMirror>
        Overrides:
        visitMethodInvocation in class com.sun.source.util.SimpleTreeVisitor<java.lang.Void,​AnnotatedTypeMirror>
        Parameters:
        tree - a method invocation tree
        type - the type of tree (i.e. the return type of the invoked method). Is (possibly) side-effected by this method.
        Returns:
        nothing, works by side-effect on type