Package com.floragunn.codova.documents
Class DocNode
java.lang.Object
com.floragunn.codova.documents.DocNode
- Direct Known Subclasses:
JacksonJsonNodeAdapter
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocNodevoidclear()booleancontainsValue(Object value) booleanList<?>findByJsonPath(String jsonPath) com.floragunn.fluent.collections.ImmutableList<DocNode>findNodesByJsonPath(String jsonPath) findSingleNodeByJsonPath(String jsonPath) <T> TfindSingleValueByJsonPath(String jsonPath, Class<T> type) flatten()abstract Object<R> Rget(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) <R> com.floragunn.fluent.collections.ImmutableList<R>getAsList(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) <R> com.floragunn.fluent.collections.ImmutableList<R>getAsListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction) <R> com.floragunn.fluent.collections.ImmutableList<R>getAsListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) abstract com.floragunn.fluent.collections.ImmutableList<DocNode>getAsListOfNodes(String attribute) com.floragunn.fluent.collections.ImmutableList<String>getAsListOfStrings(String attribute) abstract DocNodegetAsString(String attribute) getBigDecimal(String attribute) getBoolean(String attribute) <R> RgetFromNode(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) getKey()<R> com.floragunn.fluent.collections.ImmutableList<R>getList(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) <R> com.floragunn.fluent.collections.ImmutableList<R>getListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) com.floragunn.fluent.collections.ImmutableList<String>getListOfStrings(String attribute) booleanbooleanhasNonNull(String attribute) booleanisFlat()abstract booleanisList()abstract booleanabstract booleanisMap()booleanisNull()booleanisNumber()booleanisScalar()booleanisString()static DocNodestatic DocNodestatic DocNodestatic DocNodestatic DocNodeof(String k1, Object v1, String k2, Object v2, String k3, Object v3, String k4, Object v4, String k5, Object v5, Object... more) static DocNode.DocNodeParserBuilderparse(ContentType contentType) static DocNode.DocNodeParserBuilderstatic DocNodeparse(UnparsedDocument<?> unparsedDoc) voidabstract DocNodeabstract com.floragunn.fluent.collections.ImmutableList<Object>toList()com.floragunn.fluent.collections.ImmutableList<DocNode>com.floragunn.fluent.collections.ImmutableList<String>toMap()toNumber()toString()protected StringtoString(int maxChars) static DocNodeMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.floragunn.codova.documents.Document
meta, toBytes, toDeepBasicObject, toDocNode, toPrettyJsonString, toSmileMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Field Details
-
EMPTY
-
NULL
-
key
-
-
Constructor Details
-
DocNode
public DocNode()
-
-
Method Details
-
parse
-
parse
-
parse
- Throws:
DocumentParseException
-
of
-
of
-
of
-
of
-
of
-
wrap
-
array
-
get
-
getAsListOfNodes
-
getAsNode
-
toMap
-
isMap
public abstract boolean isMap() -
isList
public abstract boolean isList() -
isList
-
isScalar
public boolean isScalar() -
toList
-
splitDottedAttributeNamesToTree
public abstract DocNode splitDottedAttributeNamesToTree() throws UnexpectedDocumentStructureException -
toBasicObject
- Specified by:
toBasicObjectin interfaceDocument<Object>
-
toMapOfNodes
-
toListOfNodes
-
isNull
public boolean isNull() -
isString
public boolean isString() -
isNumber
public boolean isNumber() -
hasAny
-
with
-
with
-
without
-
get
-
getAsNode
-
toListOfStrings
-
getAsString
-
getNumber
- Throws:
ConfigValidationException
-
getBigDecimal
- Throws:
ConfigValidationException
-
getBoolean
- Throws:
ConfigValidationException
-
get
public <R> R get(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getFromNode
public <R> R getFromNode(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getList
public <R> com.floragunn.fluent.collections.ImmutableList<R> getList(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getListFromNodes
public <R> com.floragunn.fluent.collections.ImmutableList<R> getListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getAsList
public <R> com.floragunn.fluent.collections.ImmutableList<R> getAsList(String attribute, ValidatingFunction<String, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getAsListFromNodes
public <R> com.floragunn.fluent.collections.ImmutableList<R> getAsListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction) throws ConfigValidationException- Throws:
ConfigValidationException
-
getAsListFromNodes
public <R> com.floragunn.fluent.collections.ImmutableList<R> getAsListFromNodes(String attribute, ValidatingFunction<DocNode, R> conversionFunction, Object expected) throws ConfigValidationException- Throws:
ConfigValidationException
-
getListOfStrings
public com.floragunn.fluent.collections.ImmutableList<String> getListOfStrings(String attribute) throws ConfigValidationException - Throws:
ConfigValidationException
-
getAsListOfStrings
-
hasNonNull
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
getKey
-
findByJsonPath
-
findNodesByJsonPath
-
findSingleValueByJsonPath
-
findSingleNodeByJsonPath
-
put
-
remove
-
putAll
-
clear
public void clear() -
toNormalizedMap
-
toNumber
- Throws:
ConfigValidationException
-
toString
-
toJsonString
- Specified by:
toJsonStringin interfaceDocument<Object>
-
toYamlString
- Specified by:
toYamlStringin interfaceDocument<Object>
-
toString
-
toString
-
equals
-
flatten
-
isFlat
public boolean isFlat()
-