Skip to content

Package io.github.qishr.cascara.lang.yaml.ast

Class YamlComment

java.lang.Object
        io.github.qishr.cascara.lang.yaml.ast.YamlNode
                io.github.qishr.cascara.lang.yaml.ast.YamlComment

All Implemented Interfaces:
    CommentAstNode


public class YamlComment
extends YamlNode

Represents a comment within the YAML source.

Constructor Summary

Constructor Description
YamlComment(YamlToken token, String text, boolean multiLine)

Method Summary

Modifier and Type Method Description
public String asString() The actual comment text without the '#'
public boolean isMultiLine() Useful for CSS or Java modules
public List<YamlNode> getChildren() Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries.
public String getLexeme()
public void accept(YamlVisitor visitor)

Methods inherited from YamlNode

getNodeStyle, getOptions, getTag, setAnchor, getStartColumn, addComments, getStartLine, hashCode, getEndColumn, getEndLine, getComments, setTag, setNodeStyle, addComment, getToken, getAnchor, equals

Method Details

asString

public String asString()

The actual comment text without the '#'

Specified By:

CommentAstNode


isMultiLine

public boolean isMultiLine()

Useful for CSS or Java modules

Specified By:

CommentAstNode


getChildren

public List<YamlNode> getChildren()

Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries.

Overrides:

YamlNode


getLexeme

public String getLexeme()

Specified By:

CommentAstNode


accept

public void accept(YamlVisitor visitor)

Overrides:

YamlNode