Skip to content

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

Class JsonScalarNode

java.lang.Object
        io.github.qishr.cascara.lang.json.ast.JsonNode
                io.github.qishr.cascara.lang.json.ast.JsonScalarNode

All Implemented Interfaces:
    ScalarAstNode<JsonNode>


public class JsonScalarNode
extends JsonNode

Constructor Summary

Constructor Description
JsonScalarNode(int line, int column, String raw, String unescapedContent, QuoteStyle quoteStyle) Constructor for use in parsers.
JsonScalarNode(Object primitiveValue, QuoteStyle quoteStyle) A programmatic and serializer constructor.
JsonScalarNode(Object primitiveValue) A programmatic and serializer constructor.
JsonScalarNode() The default constructor

Method Summary

Modifier and Type Method Description
public List<JsonNode> getChildren()
public QuoteStyle getQuoteStyle()
public void setQuoteStyle(QuoteStyle style)
public String getRaw()
public Object getPrimitive()
public void setPrimitive(Object value)
public String asString() Returns the logical clean text value, stripped of outer formatting and escape markers.
public int asInteger()
public int asInteger(int defaultValue)
public double asDouble()
public double asDouble(double defaultValue)
public boolean asBoolean()
public boolean asBoolean(boolean defaultValue)
public boolean equals(Object o)
public int hashCode()
public String toString()

Methods inherited from JsonNode

getEndColumn, getEndLine, getComments, getStartColumn, getToken, setToken, addComment, getStartLine

Method Details

getChildren

public List<JsonNode> getChildren()


getQuoteStyle

public QuoteStyle getQuoteStyle()

Specified By:

ScalarAstNode


setQuoteStyle

public void setQuoteStyle(QuoteStyle style)

Specified By:

ScalarAstNode


getRaw

public String getRaw()

Specified By:

ScalarAstNode


getPrimitive

public Object getPrimitive()

Specified By:

ScalarAstNode


setPrimitive

public void setPrimitive(Object value)

Specified By:

ScalarAstNode


asString

public String asString()

Returns the logical clean text value, stripped of outer formatting and escape markers.

Specified By:

ScalarAstNode


asInteger

public int asInteger()

Specified By:

ScalarAstNode


asInteger

public int asInteger(int defaultValue)

Specified By:

ScalarAstNode


asDouble

public double asDouble()

Specified By:

ScalarAstNode


asDouble

public double asDouble(double defaultValue)

Specified By:

ScalarAstNode


asBoolean

public boolean asBoolean()

Specified By:

ScalarAstNode


asBoolean

public boolean asBoolean(boolean defaultValue)

Specified By:

ScalarAstNode


equals

public boolean equals(Object o)


hashCode

public int hashCode()


toString

public String toString()