Package org.commonmark.ext.front.matter
Class YamlFrontMatterVisitor
java.lang.Object
org.commonmark.node.AbstractVisitor
org.commonmark.ext.front.matter.YamlFrontMatterVisitor
- All Implemented Interfaces:
Visitor
-
Field Summary
Fields -
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.booleanReads the YAML front matter metadata, if the Markdown document has the front matter and the extension usesYamlSubsetParser(default).static StringreadRawContent(Node document) Reads the raw content of the front matter, if the Markdown document has the front matter and the extension usesRawContentParser.voidvisit(CustomNode customNode)
-
Field Details
-
present
private boolean present -
data
-
-
-
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
- Specified by:
visitin interfaceVisitor- Overrides:
visitin classAbstractVisitor
-
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()
-