Class JavaTypeVisitor<P>

  • Direct Known Subclasses:
    UnsafeJavaTypeVisitor

    public class JavaTypeVisitor<P>
    extends java.lang.Object
    • Constructor Detail

      • JavaTypeVisitor

        public JavaTypeVisitor()
    • 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)
      • preVisit

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

        @Nullable
        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.
      • 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
      • 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