| 构造器和说明 |
|---|
JsonArrayNode() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addNode(JsonNode jsonNode)
Add a JsonNode as its elements.
|
String |
compactString()
Produces a json string in a compact format.
|
static JsonArrayNode |
of(Collection<?> collection)
Creates a JsonArrayNode with a given collection.
|
static JsonArrayNode |
of(Object[] objects)
Creates a JsonArrayNode with a given array.
|
String |
prettyString(int indentation)
Produces a json string with indentations.
|
void |
setDefaultNode(JsonNode jsonNode)
Sets the default node.
|
void |
setParameters(List<String> listParam)
Sets the list parameter.
|
void |
setParameters(Map<String,String> mapParam)
Sets the map parameter.
|
void |
setParameters(String singleParam)
Sets the single parameter.
|
public static JsonArrayNode of(Collection<?> collection)
collection - list of elementspublic static JsonArrayNode of(Object[] objects)
objects - array of elementspublic void addNode(JsonNode jsonNode)
jsonNode - a child nodepublic void setDefaultNode(JsonNode jsonNode)
jsonNode - default nodepublic void setParameters(String singleParam)
By default, the single parameter is interpreted as the size specification of the array.
For example, template @s[](5) is a short hand
for @s[](size=5).
singleParam - single parameter of the array specificationsetParameters(Map)public void setParameters(List<String> listParam)
By default, the list parameter is interpreted as the size range specification of the array.
For example, template @s[](2, 5) is a short hand
for @s[](min=2, max=5).
listParam - the list parameter of the array specificationsetParameters(Map)public void setParameters(Map<String,String> mapParam)
Currently, only size, min, max are supported.
If the template has already specified the contained elements, The result size range will always first satisfy the elements, then the size specification, and at last the min and max specification. For example,
mapParam - the map parameter of the array specificationpublic String compactString()
JsonNodecompactString 在接口中 JsonNodepublic String prettyString(int indentation)
JsonNodeprettyString 在接口中 JsonNodeindentation - the amount of indentationsCopyright © 2019. All rights reserved.