Package fmpp.models

Class JSONArrayNode

  • All Implemented Interfaces:
    freemarker.template.AdapterTemplateModel, freemarker.template.TemplateModel, freemarker.template.TemplateNodeModel, freemarker.template.TemplateSequenceModel, java.io.Serializable

    public class JSONArrayNode
    extends JSONNode
    implements freemarker.template.TemplateSequenceModel
    JSON "array" value; see http://www.json.org/. This class is NOT thread safe.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_NODE_NAME

        public static final java.lang.String DEFAULT_NODE_NAME
    • Constructor Detail

      • JSONArrayNode

        public JSONArrayNode​(JSONNode parentNode,
                             java.lang.String nodeName,
                             java.util.List elements)
    • Method Detail

      • getChildNodes

        public freemarker.template.TemplateSequenceModel getChildNodes()
                                                                throws freemarker.template.TemplateModelException
        Returns the JSONNode-s in this JSON array, using a JSONNullNode for JSON null-s. Note that get(int) treats JSON null-s differently.
        Specified by:
        getChildNodes in interface freemarker.template.TemplateNodeModel
        Throws:
        freemarker.template.TemplateModelException
      • getNodeType

        public java.lang.String getNodeType()
                                     throws freemarker.template.TemplateModelException
        Returns NODE_TYPE.
        Specified by:
        getNodeType in interface freemarker.template.TemplateNodeModel
        Throws:
        freemarker.template.TemplateModelException
      • get

        public freemarker.template.TemplateModel get​(int idx)
                                              throws freemarker.template.TemplateModelException
        Returns the JSONNode at the given index from this JSON array, using a Java null for JSON null-s. Note that getChildNodes() treats JSON null-s differently.
        Specified by:
        get in interface freemarker.template.TemplateSequenceModel
        Throws:
        freemarker.template.TemplateModelException
      • size

        public int size()
                 throws freemarker.template.TemplateModelException
        Specified by:
        size in interface freemarker.template.TemplateSequenceModel
        Throws:
        freemarker.template.TemplateModelException
      • getAdaptedObject

        public java.util.List<java.lang.Object> getAdaptedObject​(java.lang.Class<?> hint)
        Returns the plain Java object wrapped into this node.
        Specified by:
        getAdaptedObject in interface freemarker.template.AdapterTemplateModel
        Since:
        0.9.16