Package org.openrewrite.java
Class JavaTypeVisitor<P>
- java.lang.Object
-
- org.openrewrite.java.JavaTypeVisitor<P>
-
- Direct Known Subclasses:
UnsafeJavaTypeVisitor
public class JavaTypeVisitor<P> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description JavaTypeVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openrewrite.CursorgetCursor()@Nullable JavaTypepostVisit(JavaType javaType, P p)@Nullable JavaTypepreVisit(JavaType javaType, P p)voidsetCursor(org.openrewrite.Cursor cursor)<JT extends JavaType>
@Nullable java.util.List<JT>visit(@Nullable java.util.List<JT> javaTypes, P p)JavaTypevisit(@Nullable JavaType javaType, P p)JavaTypevisitArray(JavaType.Array array, P p)JavaTypevisitClass(JavaType.Class aClass, P p)JavaTypevisitGenericTypeVariable(JavaType.GenericTypeVariable generic, P p)JavaTypevisitMethod(JavaType.Method method, P p)This does not visit the declaring type to avoid a visitor cycle.JavaTypevisitMultiCatch(JavaType.MultiCatch multiCatch, P p)JavaTypevisitNonNull(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.JavaTypevisitParameterized(JavaType.Parameterized parameterized, P p)JavaTypevisitPrimitive(JavaType.Primitive primitive, P p)JavaTypevisitVariable(JavaType.Variable variable, P p)This does not visit the owner to avoid a visitor cycle.
-
-
-
Method Detail
-
getCursor
public org.openrewrite.Cursor getCursor()
-
setCursor
public void setCursor(org.openrewrite.Cursor cursor)
-
visit
@Nullable public <JT extends JavaType> @Nullable java.util.List<JT> visit(@Nullable @Nullable java.util.List<JT> javaTypes, 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.
-
visitMultiCatch
public JavaType visitMultiCatch(JavaType.MultiCatch multiCatch, 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)
-
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 visitp- 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 visitp- Visit context- Returns:
- A variable
-
-