Interface AnnotatedTypeVisitor<R,P>

Type Parameters:
R - the return type of this visitor's methods. Use Void for visitors that do not need to return results.
P - the type of the additional parameter to this visitor's methods. Use Void for visitors that do not need an additional parameter.
All Known Implementing Classes:
AnnotatedTypeCombiner, AnnotatedTypeCopier, AnnotatedTypeCopierWithReplacement.Visitor, AnnotatedTypeFactory.CapturedTypeVarSubstitutor, AnnotatedTypeReplacer, AnnotatedTypeScanner, BaseTypeValidator, DefaultAnnotatedTypeFormatter.FormattingVisitor, DefaultForTypeAnnotator, DefaultQualifierForUseTypeAnnotator, DoubleAnnotatedTypeScanner, HashcodeAtmVisitor, InitializationAnnotatedTypeFactory.CommitmentTypeAnnotator, IrrelevantTypeAnnotator, ListTypeAnnotator, MustCallTypeAnnotator, NullnessAnnotatedTypeFactory.NullnessTypeAnnotator, NullnessAnnotatedTypeFormatter.NullnessFormattingVisitor, PropagationTypeAnnotator, QualifierDefaults.DefaultApplierElement.DefaultApplierElementImpl, ReportVisitor.ReportTypeValidator, SimpleAnnotatedTypeScanner, SimpleAnnotatedTypeVisitor, TypeAnnotator, TypeVariableSubstitutor.Visitor, UnitsAnnotatedTypeFormatter.UnitsFormattingVisitor

public interface AnnotatedTypeVisitor<R,P>
A visitor of annotated types, in the style of the visitor design pattern.

Classes implementing this interface are used to operate on a type when the kind of type is unknown at compile time. When a visitor is passed to a type's accept method, the visitXYZ method most applicable to that type is invoked.

Classes implementing this interface may or may not throw a NullPointerException if the additional parameter p is null; see documentation of the implementing class for details.

This visitor visits every type that is written in the source code. It is not sufficient appropriate if you want to ensure that no expression of a given type ever exists.

  • Method Details

    • visit

      R visit(AnnotatedTypeMirror type)
      A convenience method equivalent to v.visit(t, null).
      Parameters:
      type - the type to visit
      Returns:
      a visitor-specified result
    • visit

      R visit(AnnotatedTypeMirror type, P p)
      Visits a type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitDeclared

      Visits a declared type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitIntersection

      R visitIntersection(AnnotatedTypeMirror.AnnotatedIntersectionType type, P p)
      Visits an intersection type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitUnion

      Visits an union type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitExecutable

      R visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType type, P p)
      Visits an executable type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitArray

      Visits an array type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitTypeVariable

      R visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable type, P p)
      Visits a type variable.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitPrimitive

      Visits a primitive type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitNoType

      R visitNoType(AnnotatedTypeMirror.AnnotatedNoType type, P p)
      Visits NoType type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitNull

      Visits a null type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result
    • visitWildcard

      Visits a wildcard type.
      Parameters:
      type - the type to visit
      p - a visitor-specified parameter
      Returns:
      a visitor-specified result