Package org.openrewrite.text
Class PlainText
- java.lang.Object
-
- org.openrewrite.text.PlainText
-
- All Implemented Interfaces:
SourceFile,Tree
public class PlainText extends java.lang.Object implements SourceFile, Tree
The simplest of all ASTs representing nothing more than just unstructured text.
-
-
Constructor Summary
Constructors Constructor Description PlainText()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R extends Tree,P>
Raccept(TreeVisitor<R,P> v, P p)Supports polymorphic visiting viaTreeVisitor.visit(Tree, Object).<P> booleanisAcceptable(TreeVisitor<?,P> v, P p)Checks the supplied argument to see if the supplied visitor and its context would be valid arguments to accept().<P> TreeVisitor<?,PrintOutputCapture<P>>printer(Cursor cursor)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrewrite.SourceFile
getMarkers, getSourcePath, getStyle, printAll, printAll, printAllTrimmed, printAllTrimmed, withMarkers, withSourcePath
-
Methods inherited from interface org.openrewrite.Tree
getId, getJacksonPolymorphicTypeTag, isScope, print, print, print, print, printTrimmed, printTrimmed, printTrimmed
-
-
-
-
Method Detail
-
isAcceptable
public <P> boolean isAcceptable(TreeVisitor<?,P> v, P p)
Description copied from interface:TreeChecks the supplied argument to see if the supplied visitor and its context would be valid arguments to accept(). Typically this involves checking that the visitor is of a type that operates on this kind of tree. e.g.: A Java Tree implementation would return true for JavaVisitors and false for MavenVisitors- Specified by:
isAcceptablein interfaceTree- Type Parameters:
P- the visitor's context argument- Returns:
- 'true' if the arguments to this function would be valid arguments to accept()
-
accept
public <R extends Tree,P> R accept(TreeVisitor<R,P> v, P p)
Description copied from interface:TreeSupports polymorphic visiting viaTreeVisitor.visit(Tree, Object). This is useful in cases where an AST type contains a field that is of a type with a hierarchy. The visitor doesn't have to figure out which visit method to call by using instanceof.
-
printer
public <P> TreeVisitor<?,PrintOutputCapture<P>> printer(Cursor cursor)
- Specified by:
printerin interfaceSourceFile- Specified by:
printerin interfaceTree
-
-