Class PropagationTypeAnnotator

    • Constructor Detail

      • PropagationTypeAnnotator

        public PropagationTypeAnnotator​(AnnotatedTypeFactory typeFactory)
        Creates a new PropagationTypeAnnotator.
        Parameters:
        typeFactory - the type factory
    • Method Detail

      • reset

        public void reset()
        Description copied from class: AnnotatedTypeScanner
        Reset the scanner to allow reuse of the same instance. Subclasses should override this method to clear their additional state; they must call the super implementation.
        Overrides:
        reset in class AnnotatedTypeScanner<java.lang.Void,​java.lang.Void>
      • scan

        protected java.lang.Void scan​(AnnotatedTypeMirror type,
                                      java.lang.Void aVoid)
        Description copied from class: AnnotatedTypeScanner
        Scan type by calling type.accept(this, p); this method may be overridden by subclasses.
        Overrides:
        scan in class AnnotatedTypeScanner<java.lang.Void,​java.lang.Void>
        Parameters:
        type - type to scan
        aVoid - the parameter to use
        Returns:
        the result of visiting type
      • visitDeclared

        public java.lang.Void visitDeclared​(AnnotatedTypeMirror.AnnotatedDeclaredType declaredType,
                                            java.lang.Void aVoid)
        Sometimes the underlying type parameters of AnnotatedWildcardTypes are not available on the wildcards themselves. Instead, record enclosing class to find the type parameter to use as a backup in visitWildcards.
        Specified by:
        visitDeclared in interface AnnotatedTypeVisitor<java.lang.Void,​java.lang.Void>
        Overrides:
        visitDeclared in class AnnotatedTypeScanner<java.lang.Void,​java.lang.Void>
        Parameters:
        declaredType - type to record
        aVoid - a visitor-specified parameter
        Returns:
        a visitor-specified result
      • visitWildcard

        public java.lang.Void visitWildcard​(AnnotatedTypeMirror.AnnotatedWildcardType wildcard,
                                            java.lang.Void aVoid)
        Rather than defaulting the missing bounds of a wildcard, find the bound annotations on the type parameter it replaced. Place those annotations on the wildcard.
        Specified by:
        visitWildcard in interface AnnotatedTypeVisitor<java.lang.Void,​java.lang.Void>
        Overrides:
        visitWildcard in class AnnotatedTypeScanner<java.lang.Void,​java.lang.Void>
        Parameters:
        wildcard - type to annotate
        aVoid - a visitor-specified parameter
        Returns:
        a visitor-specified result