public class MarkdownParser extends Object
| Constructor and Description |
|---|
MarkdownParser(Parameters params)
Create a new
MarkdownParser that uses the platform-specific newline. |
MarkdownParser(Parameters params,
String newline)
Create a new
MarkdownParser that uses the specified string as a newline. |
| Modifier and Type | Method and Description |
|---|---|
String |
dumpTokens()
Dumps all tokens.
|
String |
getNewline() |
MarkdownToken |
getNextToken()
Returns the next available token.
|
boolean |
hasNextToken() |
void |
parse(String markdownContent)
Parse the given Markdown content into tokens that can be then retrieved with
calls to
getNextToken(). |
void |
setNewline(String newline) |
String |
toString()
Returns a string representation the AST generated by the parser from the last
call to
parse(String). |
public MarkdownParser(Parameters params)
MarkdownParser that uses the platform-specific newline.public MarkdownParser(Parameters params, String newline)
MarkdownParser that uses the specified string as a newline.newline - The newline type that this parser will usepublic void parse(String markdownContent)
getNextToken(). Any existing tokens from
previous calls to parse(String) will be discarded.markdownContent - The Markdown content to parse into tokenspublic boolean hasNextToken()
public MarkdownToken getNextToken()
IllegalStateException - If no more tokens are remainingpublic String getNewline()
public void setNewline(String newline)
public String dumpTokens()
public String toString()
parse(String).
System.out.println(markdownParser.toString())
Copyright © 2021. All rights reserved.