Package org.openrewrite
Interface Parser
- All Known Implementing Classes:
BinaryParser
,PlainTextParser
,QuarkParser
public interface Parser
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static class
A source input. -
Method Summary
Modifier and TypeMethodDescriptionboolean
default boolean
accept
(Parser.Input input) default Stream<Parser.Input>
acceptedInputs
(Iterable<Parser.Input> input) default Charset
Returns the ExecutionContext charset if its defined otherwise returnsStandardCharsets.UTF_8
default Stream<SourceFile>
parse
(Iterable<Path> sourceFiles, @Nullable Path relativeTo, ExecutionContext ctx) default Stream<SourceFile>
default Stream<SourceFile>
parse
(ExecutionContext ctx, String... sources) parseInputs
(Iterable<Parser.Input> sources, @Nullable Path relativeTo, ExecutionContext ctx) default SourceFile
requirePrintEqualsInput
(SourceFile sourceFile, Parser.Input input, @Nullable Path relativeTo, ExecutionContext ctx) default Parser
reset()
sourcePathFromSourceText
(Path prefix, String sourceCode)
-
Method Details
-
requirePrintEqualsInput
@Incubating(since="8.2.0") default SourceFile requirePrintEqualsInput(SourceFile sourceFile, Parser.Input input, @Nullable Path relativeTo, ExecutionContext ctx) -
parse
default Stream<SourceFile> parse(Iterable<Path> sourceFiles, @Nullable Path relativeTo, ExecutionContext ctx) -
parse
-
parse
-
parseInputs
Stream<SourceFile> parseInputs(Iterable<Parser.Input> sources, @Nullable Path relativeTo, ExecutionContext ctx) - Parameters:
sources
- A collection of inputs. At the conclusion of parsing all sources'Parser.Input.source
are closed.relativeTo
- A common relative path for allParser.Input.path
.ctx
- The execution context- Returns:
- A stream of
SourceFile
.
-
accept
-
accept
-
acceptedInputs
-
reset
-
getCharset
Returns the ExecutionContext charset if its defined otherwise returnsStandardCharsets.UTF_8
-
sourcePathFromSourceText
-