Package org.openrewrite
Interface Parser<S extends SourceFile>
- All Known Implementing Classes:
BinaryParser,PlainTextParser,QuarkParser
public interface Parser<S extends SourceFile>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classA source input. -
Method Summary
Modifier and TypeMethodDescriptionbooleandefault booleanaccept(Parser.Input input) default List<Parser.Input>acceptedInputs(Iterable<Parser.Input> input) default CharsetReturns the ExecutionContext charset if its defined otherwise returnsStandardCharsets.UTF_8parse(ExecutionContext ctx, String... sources) parseInputs(Iterable<Parser.Input> sources, @Nullable Path relativeTo, ExecutionContext ctx) reset()sourcePathFromSourceText(Path prefix, String sourceCode)
-
Method Details
-
parse
-
parse
-
parse
-
parseInputs
List<S> parseInputs(Iterable<Parser.Input> sources, @Nullable @Nullable Path relativeTo, ExecutionContext ctx) - 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 list of
SourceFile.
-
accept
-
accept
-
acceptedInputs
-
reset
-
getCharset
Returns the ExecutionContext charset if its defined otherwise returnsStandardCharsets.UTF_8 -
sourcePathFromSourceText
-