Class JavaTypeVisitor<P>

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

public class JavaTypeVisitor<P> extends Object
  • Constructor Details

    • JavaTypeVisitor

      public JavaTypeVisitor()
  • Method Details

    • getCursor

      public org.openrewrite.Cursor getCursor()
    • setCursor

      public void setCursor(org.openrewrite.Cursor cursor)
    • 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 @Nullable 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)
    • 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)
    • 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