Package org.openrewrite.java
Class JavaTypeVisitor<P>
java.lang.Object
org.openrewrite.java.JavaTypeVisitor<P>
- Direct Known Subclasses:
JavaTypeReceiver,JavaTypeSender,UnsafeJavaTypeVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable JavaType@Nullable JavaTypevisitAnnotation(JavaType.Annotation annotation, P p) Visit the JavaType refs embedded in an annotation element value — theelementmeta-variable and anyreferenceValue(s).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) visitUnknown(JavaType.Unknown unknown, 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
-
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
-
visitAnnotationElementValue
public JavaType.Annotation.ElementValue visitAnnotationElementValue(JavaType.Annotation.ElementValue ev, P p) Visit the JavaType refs embedded in an annotation element value — theelementmeta-variable and anyreferenceValue(s). Constant values never holdJavaTypeinstances 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 othervisit*methods on this visitor. -
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
-
visitUnknown
-
visitVariable
This does not visit the owner to avoid a visitor cycle.- Parameters:
variable- The variable to visitp- Visit context- Returns:
- A variable
-