Class JavaTypeVisitor<P>

java.lang.Object
org.openrewrite.java.JavaTypeVisitor<P>
Direct Known Subclasses:
JavaTypeReceiver, JavaTypeSender, UnsafeJavaTypeVisitor

public class JavaTypeVisitor<P> extends Object
  • Constructor Details

    • JavaTypeVisitor

      public JavaTypeVisitor()
  • Method Details

    • visit

      public <JT extends JavaType> @Nullable List<JT> visit(@Nullable List<JT> javaTypes, P p)
    • preVisit

      public @Nullable JavaType preVisit(JavaType javaType, P p)
    • postVisit

      public @Nullable JavaType postVisit(JavaType javaType, P p)
    • visitNonNull

      public JavaType visitNonNull(JavaType javaType, P p)
      By calling this method, you are asserting that you know that the outcome will be non-null when the compiler couldn't otherwise prove this to be the case. This method is a shortcut for having to assert the non-nullability of the returned tree.
      Parameters:
      javaType - A non-null type.
      p - A state object that passes through the visitor.
      Returns:
      A non-null type.
    • visit

      public JavaType visit(@Nullable JavaType javaType, P p)
    • visitMultiCatch

      public JavaType visitMultiCatch(JavaType.MultiCatch multiCatch, P p)
    • visitAnnotation

      public JavaType visitAnnotation(JavaType.Annotation annotation, P p)
    • visitAnnotationElementValue

      public JavaType.Annotation.ElementValue visitAnnotationElementValue(JavaType.Annotation.ElementValue ev, P p)
      Visit the JavaType refs embedded in an annotation element value — the element meta-variable and any referenceValue(s). Constant values never hold JavaType instances in practice: Single- and ArrayElementValue#from route JavaType-valued arguments into the reference branch, so the constant side is only ever primitives, strings, and enums. The default implementation returns the same ElementValue when no referenced JavaType changed identity, matching the semantics of the other visit* methods on this visitor.
    • visitArray

      public JavaType visitArray(JavaType.Array array, P p)
    • visitClass

      public JavaType visitClass(JavaType.Class aClass, P p)
    • visitGenericTypeVariable

      public JavaType visitGenericTypeVariable(JavaType.GenericTypeVariable generic, P p)
    • visitIntersection

      public JavaType visitIntersection(JavaType.Intersection intersection, P p)
    • visitMethod

      public JavaType visitMethod(JavaType.Method method, P p)
      This does not visit the declaring type to avoid a visitor cycle.
      Parameters:
      method - The method to visit
      p - Visit context
      Returns:
      A method
    • visitParameterized

      public JavaType visitParameterized(JavaType.Parameterized parameterized, P p)
    • visitPrimitive

      public JavaType visitPrimitive(JavaType.Primitive primitive, P p)
    • visitUnknown

      public JavaType visitUnknown(JavaType.Unknown unknown, P p)
    • visitVariable

      public JavaType visitVariable(JavaType.Variable variable, P p)
      This does not visit the owner to avoid a visitor cycle.
      Parameters:
      variable - The variable to visit
      p - Visit context
      Returns:
      A variable