public abstract class JsonValueImpl extends Object implements JsonValue
| Constructor and Description |
|---|
JsonValueImpl() |
| Modifier and Type | Method and Description |
|---|---|
JsonArray |
asArray()
Cast this value instance to JsonArray
|
JsonBoolLiteral |
asBoolLiteral()
Cast this value instance to JsonBoolLiteral
|
JsonExpLiteral |
asExpLiteral()
Cast this value instance to JsonExpLiteralImpl
|
JsonFracLiteral |
asFracLiteral()
Cast this value instance to JsonFracLiteral
|
JsonIntLiteral |
asIntLiteral()
Cast this value instance to JsonIntLiteral
|
JsonLiteral |
asLiteral()
Cast this value instance to JsonLiteral
|
JsonNullLiteral |
asNullLiteral()
Cast this value instance to JsonNullLiteral
|
JsonObject |
asObject()
Cast this value instance to JsonObject
|
JsonStringLiteral |
asStringLiteral()
Cast this value instance to JsonStringLiteral
|
List<JsonValue> |
findAll(PathMatcher matcher)
Find all json values with defined path
|
abstract void |
findAll(PathMatcher matcher,
List<JsonValue> values,
List<String> path) |
List<String> |
findAllLiterals(PathMatcher matcher)
Find all json value with defined path and converts them to string value
|
JsonValue |
findFirst(PathMatcher matcher)
Find first json value with defined path
|
abstract JsonValue |
findFirst(PathMatcher matcher,
List<String> path) |
String |
findFirstLiteral(PathMatcher matcher)
Find first json value with defined path and converts it to string value
|
boolean |
isArray()
Checks if this value is instance of JsonArray
|
boolean |
isBoolLiteral()
Checks if this value is instance of JsonBoolLiteral
|
boolean |
isExpLiteral()
Checks if this value is instance of JsonExpLiteral
|
boolean |
isFracLiteral()
Checks if this value is instance of JsonFracLiteral
|
boolean |
isIntLiteral()
Checks if this value is instance of JsonIntLiteral
|
boolean |
isLiteral()
Checks if this value is instance of JsonLiteral
|
boolean |
isNullLiteral()
Checks if this value is instance of JsonNullLiteral
|
boolean |
isObject()
Checks if this value is instance of JsonObject
|
boolean |
isStringLiteral()
Checks if this value is instance of JsonStringLiteral
|
JsonValue |
parent()
Parent of this value in json structure
|
int |
parentIndex()
Index of this instance in parent object
|
String[] |
path()
Returns path of this value in json structure
|
String |
toCompactString()
Produces compact string representation of this json value.
|
abstract void |
toCompactString(StringBuilder sb) |
String |
toPrettyString(String indent)
Produces pretty (readable) string representation of this json value.
|
abstract void |
toPrettyString(StringBuilder sb,
String prefix,
String indent) |
public JsonObject asObject()
JsonValuepublic JsonArray asArray()
JsonValuepublic JsonNullLiteral asNullLiteral()
JsonValueasNullLiteral in interface JsonValuepublic JsonBoolLiteral asBoolLiteral()
JsonValueasBoolLiteral in interface JsonValuepublic JsonExpLiteral asExpLiteral()
JsonValueasExpLiteral in interface JsonValuepublic JsonFracLiteral asFracLiteral()
JsonValueasFracLiteral in interface JsonValuepublic JsonIntLiteral asIntLiteral()
JsonValueasIntLiteral in interface JsonValuepublic JsonStringLiteral asStringLiteral()
JsonValueasStringLiteral in interface JsonValuepublic JsonLiteral asLiteral()
JsonValuepublic boolean isObject()
JsonValuepublic boolean isArray()
JsonValuepublic boolean isNullLiteral()
JsonValueisNullLiteral in interface JsonValuepublic boolean isBoolLiteral()
JsonValueisBoolLiteral in interface JsonValuepublic boolean isExpLiteral()
JsonValueisExpLiteral in interface JsonValuepublic boolean isFracLiteral()
JsonValueisFracLiteral in interface JsonValuepublic boolean isIntLiteral()
JsonValueisIntLiteral in interface JsonValuepublic boolean isStringLiteral()
JsonValueisStringLiteral in interface JsonValuepublic boolean isLiteral()
JsonValuepublic String toCompactString()
JsonValuetoCompactString in interface JsonValuepublic String toPrettyString(String indent)
JsonValuetoPrettyString in interface JsonValueindent - string used for indend nested levels. (ussually tab or some spaces)public abstract void toCompactString(StringBuilder sb)
public abstract void toPrettyString(StringBuilder sb, String prefix, String indent)
public List<JsonValue> findAll(PathMatcher matcher)
JsonValuepublic JsonValue findFirst(PathMatcher matcher)
JsonValuepublic List<String> findAllLiterals(PathMatcher matcher)
JsonValuefindAllLiterals in interface JsonValuematcher - Matcher to used for identifying returned values.public String findFirstLiteral(PathMatcher matcher)
JsonValuefindFirstLiteral in interface JsonValuematcher - Matcher to used for identifying returned value.public abstract JsonValue findFirst(PathMatcher matcher, List<String> path)
public abstract void findAll(PathMatcher matcher, List<JsonValue> values, List<String> path)
public JsonValue parent()
JsonValuepublic int parentIndex()
JsonValueparentIndex in interface JsonValueCopyright © 2018. All rights reserved.