Class JavaRefactorVisitor

  • All Implemented Interfaces:
    JavaSourceVisitor<J>, org.openrewrite.RefactorVisitor<J>, org.openrewrite.SourceVisitor<J>
    Direct Known Subclasses:
    JavaIsoRefactorVisitor, UnwrapParentheses.Scoped

    public class JavaRefactorVisitor
    extends org.openrewrite.AbstractRefactorVisitor<J>
    implements JavaSourceVisitor<J>
    This is the class you want to extend from if your visitor might ever want to swap the AST element being visited for a different type of AST element. For example visiting a method declaration and returning a field. Most visitors do not need this flexibility and can extend JavaIsomorphicRefactorVisitor whose type signatures insist that when visiting an AST element the returned element must be of the same type.