public class ParseResult<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ParseResult.PostProcessor
A post processor that can be added to ParserConfiguration to add some processing right after parsing.
|
Constructor and Description |
---|
ParseResult(T result,
List<Problem> problems,
List<JavaToken> tokens,
CommentsCollection commentsCollection)
General constructor.
|
Modifier and Type | Method and Description |
---|---|
Optional<CommentsCollection> |
getCommentsCollection() |
Problem |
getProblem(int i) |
List<Problem> |
getProblems() |
Optional<T> |
getResult() |
void |
ifSuccessful(Consumer<T> consumer)
Calls the consumer with the result if parsing was succesful.
|
boolean |
isSuccessful() |
String |
toString() |
public ParseResult(T result, List<Problem> problems, List<JavaToken> tokens, CommentsCollection commentsCollection)
result
- the AST, or empty if it wasn't created.problems
- a list of encountered parsing problems.tokens
- the complete list of tokens that were parsed, or empty if parsing failed completely.public boolean isSuccessful()
public void ifSuccessful(Consumer<T> consumer)
public List<Problem> getProblems()
public Problem getProblem(int i)
i
'th encountered parsing problem. May throw IndexOutOfBoundsException
.public Optional<CommentsCollection> getCommentsCollection()
public Optional<T> getResult()
Copyright © 2007–2019. All rights reserved.