Package org.openrewrite.java
Class JavaTypeVisitor<P>
java.lang.Object
org.openrewrite.java.JavaTypeVisitor<P>
- Direct Known Subclasses:
UnsafeJavaTypeVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.Cursor@Nullable JavaType@Nullable JavaTypevoidsetCursor(org.openrewrite.Cursor cursor) @Nullable JavaTypevisitAnnotation(JavaType.Annotation annotation, P p) visitArray(JavaType.Array array, P p) visitClass(JavaType.Class aClass, P p) visitGenericTypeVariable(JavaType.GenericTypeVariable generic, P p) visitIntersection(JavaType.Intersection intersection, P p) visitMethod(JavaType.Method method, P p) This does not visit the declaring type to avoid a visitor cycle.visitMultiCatch(JavaType.MultiCatch multiCatch, P p) 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.visitParameterized(JavaType.Parameterized parameterized, P p) visitPrimitive(JavaType.Primitive primitive, P p) visitVariable(JavaType.Variable variable, P p) This does not visit the owner to avoid a visitor cycle.
-
Constructor Details
-
JavaTypeVisitor
public JavaTypeVisitor()
-
-
Method Details
-
getCursor
public org.openrewrite.Cursor getCursor() -
setCursor
public void setCursor(org.openrewrite.Cursor cursor) -
visit
-
preVisit
-
postVisit
-
visitNonNull
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
-
visitMultiCatch
-
visitAnnotation
-
visitArray
-
visitClass
-
visitGenericTypeVariable
-
visitIntersection
-
visitMethod
This does not visit the declaring type to avoid a visitor cycle.- Parameters:
method- The method to visitp- Visit context- Returns:
- A method
-
visitParameterized
-
visitPrimitive
-
visitVariable
This does not visit the owner to avoid a visitor cycle.- Parameters:
variable- The variable to visitp- Visit context- Returns:
- A variable
-