- java.lang.Object
-
- io.fixprotocol.md.event.DocumentParser
-
public final class DocumentParser extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDocumentParser.ParserErrorListenerListens for parser errors
-
Constructor Summary
Constructors Constructor Description DocumentParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanparse(InputStream inputStream, Consumer<? super GraphContext> contextConsumer)Parse a markdown documentbooleanparse(InputStream inputStream, Consumer<? super GraphContext> contextConsumer, DocumentParser.ParserErrorListener parserListener)Parse a markdown documentbooleanvalidate(InputStream inputStream, DocumentParser.ParserErrorListener parserListener)Validate a markdown document
-
-
-
Method Detail
-
parse
public boolean parse(InputStream inputStream, Consumer<? super GraphContext> contextConsumer) throws IOException
Parse a markdown document- Parameters:
inputStream- input as markdowncontextConsumer- consumer of document events- Returns:
trueif the document is fully parsed without errors- Throws:
IOException- if the document cannot be read
-
parse
public boolean parse(InputStream inputStream, Consumer<? super GraphContext> contextConsumer, DocumentParser.ParserErrorListener parserListener) throws IOException
Parse a markdown document- Parameters:
inputStream- input as markdowncontextConsumer- consumer of document eventsparserListener- listens for parser errors. May benull.- Returns:
trueif the document is fully parsed without errors- Throws:
IOException- if the document cannot be read
-
validate
public boolean validate(InputStream inputStream, DocumentParser.ParserErrorListener parserListener) throws IOException
Validate a markdown document- Parameters:
inputStream- input as markdownparserListener- listens for parser errors.- Returns:
trueif the document is fully parsed without errors- Throws:
IOException- if the document cannot be read
-
-