Package fmpp.models
Class JSONArrayNode
java.lang.Object
fmpp.models.JSONNode
fmpp.models.JSONArrayNode
- All Implemented Interfaces:
freemarker.template.AdapterTemplateModel,freemarker.template.TemplateModel,freemarker.template.TemplateNodeModel,freemarker.template.TemplateSequenceModel,Serializable
JSON "array" value; see http://www.json.org/.
This class is NOT thread safe.
- See Also:
-
Field Summary
FieldsFields inherited from interface freemarker.template.TemplateModel
NOTHING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfreemarker.template.TemplateModelget(int idx) getAdaptedObject(Class<?> hint) Returns the plain Java object wrapped into this node.freemarker.template.TemplateSequenceModelprotected StringReturns the name of the node if it has no explicit name.ReturnsNODE_TYPE.intsize()Methods inherited from class fmpp.models.JSONNode
getNodeName, getNodeNamespace, getParentNode, nodeTypeToDefaultNodeName, wrap, wrap
-
Field Details
-
NODE_TYPE
- See Also:
-
DEFAULT_NODE_NAME
-
-
Constructor Details
-
JSONArrayNode
-
-
Method Details
-
getChildNodes
public freemarker.template.TemplateSequenceModel getChildNodes() throws freemarker.template.TemplateModelExceptionReturns theJSONNode-s in this JSON array, using aJSONNullNodefor JSONnull-s. Note thatget(int)treats JSONnull-s differently.- Specified by:
getChildNodesin interfacefreemarker.template.TemplateNodeModel- Throws:
freemarker.template.TemplateModelException
-
getNodeType
ReturnsNODE_TYPE.- Specified by:
getNodeTypein interfacefreemarker.template.TemplateNodeModel- Throws:
freemarker.template.TemplateModelException
-
get
public freemarker.template.TemplateModel get(int idx) throws freemarker.template.TemplateModelException Returns theJSONNodeat the given index from this JSON array, using a Javanullfor JSONnull-s. Note thatgetChildNodes()treats JSONnull-s differently.- Specified by:
getin interfacefreemarker.template.TemplateSequenceModel- Throws:
freemarker.template.TemplateModelException
-
size
public int size() throws freemarker.template.TemplateModelException- Specified by:
sizein interfacefreemarker.template.TemplateSequenceModel- Throws:
freemarker.template.TemplateModelException
-
getDefaultNodeName
Description copied from class:JSONNodeReturns the name of the node if it has no explicit name. This is normally called by theJSONNode(JSONNode, String)constructor if its second argument isnull.- Specified by:
getDefaultNodeNamein classJSONNode- See Also:
-
getAdaptedObject
Returns the plain Java object wrapped into this node.- Specified by:
getAdaptedObjectin interfacefreemarker.template.AdapterTemplateModel- Since:
- 0.9.16
-