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, CommentStyle commentStyle)

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 CommentStyle getCommentStyle()
public YamlComment setCommentStyle(CommentStyle commentStyle)
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

isPreceededByNewLine, getOptions, setFileEndsWithNewLine, getTag, setAnchor, addComments, getStartLine, hashCode, fileEndsWithNewLine, getEndColumn, setTag, addComment, setPreceededByNewLine, getResolvedTag, getToken, getAnchor, getNodeStyle, toString, setNodeStyle, getStartColumn, getSemanticColumn, getEndLine, getComments, getProperties, equals, setResolvedTag, setSemanticColumn

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


getCommentStyle

public CommentStyle getCommentStyle()


setCommentStyle

public YamlComment setCommentStyle(CommentStyle commentStyle)


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