public class JSONObjectNode extends JSONNode implements TemplateHashModelEx
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NODE_NAME |
static String |
NODE_TYPE |
NOTHING| Constructor and Description |
|---|
JSONObjectNode(JSONNode parentNode,
String nodeName,
Map map) |
| Modifier and Type | Method and Description |
|---|---|
TemplateModel |
get(String key)
|
TemplateSequenceModel |
getChildNodes() |
protected String |
getDefaultNodeName()
Returns the name of the node if it has no explicit name.
|
String |
getNodeType() |
boolean |
isEmpty() |
TemplateCollectionModel |
keys() |
int |
size() |
TemplateCollectionModel |
values()
Returns the values from the key-value pairs of this JSON object, returning Java
null for JSON
null-s. |
getNodeName, getNodeNamespace, getParentNode, nodeTypeToDefaultNodeName, wrap, wrappublic static final String NODE_TYPE
public static final String DEFAULT_NODE_NAME
public JSONObjectNode(JSONNode parentNode, String nodeName, Map map)
map - The JSON name-value pairs. The keys must be String-s, and values must be of a type that
JSONNode.wrap(Object) can wrap.public String getNodeType() throws TemplateModelException
getNodeType in interface TemplateNodeModelTemplateModelExceptionpublic TemplateModel get(String key) throws TemplateModelException
JSONNode for the given key from this JSON object, using a Java null for JSON
null-s. Note that getChildNodes() treats JSON null-s differently.get in interface TemplateHashModelTemplateModelExceptionpublic boolean isEmpty()
throws TemplateModelException
isEmpty in interface TemplateHashModelTemplateModelExceptionpublic int size()
throws TemplateModelException
size in interface TemplateHashModelExTemplateModelExceptionpublic TemplateSequenceModel getChildNodes() throws TemplateModelException
getChildNodes in interface TemplateNodeModelTemplateModelExceptionpublic TemplateCollectionModel keys() throws TemplateModelException
keys in interface TemplateHashModelExTemplateModelExceptionpublic TemplateCollectionModel values() throws TemplateModelException
null for JSON
null-s. Note that getChildNodes() treats JSON null-s differently.values in interface TemplateHashModelExTemplateModelExceptionprotected String getDefaultNodeName()
JSONNodeJSONNode.JSONNode(JSONNode, String) constructor if its second argument is null.getDefaultNodeName in class JSONNodeJSONNode.nodeTypeToDefaultNodeName(String)