Class I18nFormatterVisitor

    • Constructor Detail

      • I18nFormatterVisitor

        public I18nFormatterVisitor​(BaseTypeChecker checker)
    • Method Detail

      • visitMethodInvocation

        public java.lang.Void visitMethodInvocation​(com.sun.source.tree.MethodInvocationTree tree,
                                                    java.lang.Void p)
        Description copied from class: BaseTypeVisitor
        Performs a method invocation check.

        An invocation of a method, m, on the receiver, r is valid only if:

        • passed arguments are subtypes of corresponding m parameters
        • r is a subtype of m receiver type
        • if m is generic, passed type arguments are subtypes of m type variables
        Specified by:
        visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<java.lang.Void,​java.lang.Void>
        Overrides:
        visitMethodInvocation in class BaseTypeVisitor<I18nFormatterAnnotatedTypeFactory>
      • commonAssignmentCheck

        protected boolean commonAssignmentCheck​(AnnotatedTypeMirror varType,
                                                AnnotatedTypeMirror valueType,
                                                com.sun.source.tree.Tree valueTree,
                                                @CompilerMessageKey java.lang.String errorKey,
                                                java.lang.Object... extraArgs)
        Description copied from class: BaseTypeVisitor
        Checks the validity of an assignment (or pseudo-assignment) from a value to a variable and emits an error message (through the compiler's messaging interface) if it is not valid.
        Overrides:
        commonAssignmentCheck in class BaseTypeVisitor<I18nFormatterAnnotatedTypeFactory>
        Parameters:
        varType - the annotated type of the variable
        valueType - the annotated type of the value
        valueTree - the location to use when reporting the error message
        errorKey - the error message key to use if the check fails
        extraArgs - arguments to the error message key, before "found" and "expected" types
        Returns:
        true if the check succeeds, false if an error message was issued