Package org.openrewrite.text
Class PlainTextParser
java.lang.Object
org.openrewrite.text.PlainTextParser
- All Implemented Interfaces:
Parser
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.openrewrite.Parser
Parser.Input -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic PlainTextParser.Builderbuilder()static PlainTextconvert(SourceFile sourceFile) Downcast aSourceFileto aPlainTextif it isn't already one.parseInputs(Iterable<Parser.Input> sources, @Nullable Path relativeTo, ExecutionContext ctx) sourcePathFromSourceText(Path prefix, String sourceCode) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.Parser
accept, acceptedInputs, getCharset, parse, parse, parse, requirePrintEqualsInput, reset
-
Constructor Details
-
PlainTextParser
public PlainTextParser()
-
-
Method Details
-
convert
Downcast aSourceFileto aPlainTextif it isn't already one. -
parseInputs
public Stream<SourceFile> parseInputs(Iterable<Parser.Input> sources, @Nullable @Nullable Path relativeTo, ExecutionContext ctx) - Specified by:
parseInputsin interfaceParser- Parameters:
sources- A collection of inputs. At the conclusion of parsing all sources'Parser.Input.sourceare closed.relativeTo- A common relative path for allParser.Input.path.ctx- The execution context- Returns:
- A stream of
SourceFile.
-
accept
-
sourcePathFromSourceText
- Specified by:
sourcePathFromSourceTextin interfaceParser
-
builder
-