Package fmpp.models
Class JSONNumberNode
- java.lang.Object
-
- fmpp.models.JSONNode
-
- fmpp.models.JSONNumberNode
-
- All Implemented Interfaces:
freemarker.template.AdapterTemplateModel
,freemarker.template.TemplateModel
,freemarker.template.TemplateNodeModel
,freemarker.template.TemplateNumberModel
,java.io.Serializable
public class JSONNumberNode extends JSONNode implements freemarker.template.TemplateNumberModel
JSON "number" value; see http://www.json.org/.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_NODE_NAME
static java.lang.String
NODE_TYPE
-
Constructor Summary
Constructors Constructor Description JSONNumberNode(JSONNode parentNode, java.lang.String nodeName, java.lang.Number value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
getAdaptedObject(java.lang.Class<?> hint)
Returns the plain Java object wrapped into this node.java.lang.Number
getAsNumber()
freemarker.template.TemplateSequenceModel
getChildNodes()
Always returnsnull
.protected java.lang.String
getDefaultNodeName()
Returns the name of the node if it has no explicit name.java.lang.String
getNodeType()
ReturnsNODE_TYPE
.-
Methods inherited from class fmpp.models.JSONNode
getNodeName, getNodeNamespace, getParentNode, nodeTypeToDefaultNodeName, wrap, wrap
-
-
-
-
Field Detail
-
NODE_TYPE
public static final java.lang.String NODE_TYPE
- See Also:
- Constant Field Values
-
DEFAULT_NODE_NAME
public static final java.lang.String DEFAULT_NODE_NAME
-
-
Constructor Detail
-
JSONNumberNode
public JSONNumberNode(JSONNode parentNode, java.lang.String nodeName, java.lang.Number value)
-
-
Method Detail
-
getChildNodes
public freemarker.template.TemplateSequenceModel getChildNodes() throws freemarker.template.TemplateModelException
Always returnsnull
.- Specified by:
getChildNodes
in interfacefreemarker.template.TemplateNodeModel
- Throws:
freemarker.template.TemplateModelException
-
getNodeType
public java.lang.String getNodeType() throws freemarker.template.TemplateModelException
ReturnsNODE_TYPE
.- Specified by:
getNodeType
in interfacefreemarker.template.TemplateNodeModel
- Throws:
freemarker.template.TemplateModelException
-
getAsNumber
public java.lang.Number getAsNumber() throws freemarker.template.TemplateModelException
- Specified by:
getAsNumber
in interfacefreemarker.template.TemplateNumberModel
- Throws:
freemarker.template.TemplateModelException
-
getDefaultNodeName
protected java.lang.String getDefaultNodeName()
Description copied from class:JSONNode
Returns 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:
getDefaultNodeName
in classJSONNode
- See Also:
JSONNode.nodeTypeToDefaultNodeName(String)
-
getAdaptedObject
public java.lang.Number getAdaptedObject(java.lang.Class<?> hint)
Returns the plain Java object wrapped into this node.- Specified by:
getAdaptedObject
in interfacefreemarker.template.AdapterTemplateModel
- Since:
- 0.9.16
-
-