Package net.diversionmc.json
Class JSON.JSONValue
java.lang.Object
net.diversionmc.parser.util.Pointable
net.diversionmc.parser.pattern.Sentence
net.diversionmc.json.JSON.JSONValue
- Direct Known Subclasses:
JSON.JSONArray,JSON.JSONNumber,JSON.JSONObject,JSON.JSONString
- Enclosing class:
- JSON
public abstract static sealed class JSON.JSONValue
extends net.diversionmc.parser.pattern.Sentence
permits JSON.JSONObject, JSON.JSONArray, JSON.JSONNumber, JSON.JSONString
Parsed JSON value that stores any data.
-
Constructor Summary
ConstructorsConstructorDescriptionJSONValue(net.diversionmc.parser.util.FilePointer ptr)Construct a JSON Value. -
Method Summary
Modifier and TypeMethodDescriptionasArray()Try to convert this value toJSON.JSONArray.asNumber()Try to convert this value toJSON.JSONNumber.asObject()Try to convert this value toJSON.JSONObject.asString()Try to convert this value toJSON.JSONString.Methods inherited from class net.diversionmc.parser.pattern.Sentence
isStatementMethods inherited from class net.diversionmc.parser.util.Pointable
pointer
-
Constructor Details
-
JSONValue
public JSONValue(net.diversionmc.parser.util.FilePointer ptr)Construct a JSON Value.- Parameters:
ptr- Creation position.
-
-
Method Details
-
asObject
Try to convert this value toJSON.JSONObject.- Throws:
ClassCastException
-
asArray
Try to convert this value toJSON.JSONArray.- Throws:
ClassCastException
-
asNumber
Try to convert this value toJSON.JSONNumber.- Throws:
ClassCastException
-
asString
Try to convert this value toJSON.JSONString.- Throws:
ClassCastException
-