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:
setQuoteStyle
public void setQuoteStyle(QuoteStyle style)
Specified By:
getRaw
public String getRaw()
Specified By:
getPrimitive
public Object getPrimitive()
Specified By:
setPrimitive
public void setPrimitive(Object value)
Specified By:
asString
public String asString()
Returns the logical clean text value, stripped of outer formatting and escape markers.
Specified By:
asInteger
public int asInteger()
Specified By:
asInteger
public int asInteger(int defaultValue)
Specified By:
asDouble
public double asDouble()
Specified By:
asDouble
public double asDouble(double defaultValue)
Specified By:
asBoolean
public boolean asBoolean()
Specified By:
asBoolean
public boolean asBoolean(boolean defaultValue)
Specified By:
equals
public boolean equals(Object o)
hashCode
public int hashCode()
toString
public String toString()