Class YamlFrontMatterVisitor
java.lang.Object
org.commonmark.node.AbstractVisitor
org.commonmark.ext.front.matter.YamlFrontMatterVisitor
- All Implemented Interfaces:
org.commonmark.node.Visitor
public class YamlFrontMatterVisitor
extends org.commonmark.node.AbstractVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()Returns the YAML front matter metadata, if the Markdown document has the front matter and the extension usesYamlSubsetParser(default).Returns the raw content of the front matter, if the Markdown document has the front matter and the extension usesRawContentParser.booleanreadData(org.commonmark.node.Node document) Reads the YAML front matter metadata, if the Markdown document has the front matter and the extension usesYamlSubsetParser(default).static StringreadRawContent(org.commonmark.node.Node document) Reads the raw content of the front matter, if the Markdown document has the front matter and the extension usesRawContentParser.voidvisit(org.commonmark.node.CustomNode customNode) Methods inherited from class org.commonmark.node.AbstractVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitChildren
-
Constructor Details
-
YamlFrontMatterVisitor
public YamlFrontMatterVisitor()
-
-
Method Details
-
readData
Reads the YAML front matter metadata, if the Markdown document has the front matter and the extension usesYamlSubsetParser(default).- Returns:
- The data stored in YAML front matter or empty map.
-
readRawContent
Reads the raw content of the front matter, if the Markdown document has the front matter and the extension usesRawContentParser.- Returns:
- Raw content of the front matter as string or empty string.
-
visit
public void visit(org.commonmark.node.CustomNode customNode) - Specified by:
visitin interfaceorg.commonmark.node.Visitor- Overrides:
visitin classorg.commonmark.node.AbstractVisitor
-
getData
Returns the YAML front matter metadata, if the Markdown document has the front matter and the extension usesYamlSubsetParser(default).- Returns:
- The data stored in YAML front matter or empty map
-
getRawContent
Returns the raw content of the front matter, if the Markdown document has the front matter and the extension usesRawContentParser.- Returns:
- Raw content of the front matter as string or empty string.
-
isFrontMatterPresent
public boolean isFrontMatterPresent()
-