public class JSONElementImpl extends java.lang.Object implements java.io.Serializable, DefElement
XMLElement class.
These are
created by the XML parser when using the JBONodeFactory.XMLElement,
XMLParser,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
RES_ID_SUFFIX |
NODETYPES_TEXT_CDATAATTRIBUTE_NODE, CDATA_SECTION_NODE, ELEMENT_NODE, TEXT_NODE| Constructor and Description |
|---|
JSONElementImpl(JSONElementImpl parent,
JsonNodeWrapper node,
java.lang.String tagName) |
JSONElementImpl(JsonNodeWrapper node,
java.lang.String tagName) |
JSONElementImpl(java.lang.String tagName) |
| Modifier and Type | Method and Description |
|---|---|
static JSONElementImpl |
createJSONElement(java.io.Reader reader,
java.lang.String xmlTag) |
protected void |
fillListFromArrayNode(ArrayNodeWrapper node,
java.lang.String fldName,
java.util.ArrayList list) |
DefElement |
findChildElement(java.lang.String childName)
Finds the first child element of the given node name
|
java.lang.String |
getAttribute(java.lang.String param1) |
org.w3c.dom.NamedNodeMap |
getAttributes() |
java.util.ArrayList |
getAttrsList()
Gets all the attributes of the element, in no particular order.
|
JSONElementImpl |
getChildElement(java.lang.String childName) |
org.w3c.dom.NodeList |
getChildNodes() |
java.util.Vector |
getChildren(java.lang.String childName)
Gets the child elements of the given node name.
|
org.w3c.dom.NodeList |
getChildrenByTagName(java.lang.String param1) |
org.w3c.dom.NodeList |
getChildrenByTagName(java.lang.String param1,
java.lang.String param2) |
java.util.ArrayList |
getChildrenList()
Gets all the child elements.
|
protected java.util.ArrayList |
getChildrenList(JsonNodeWrapper jsonNode) |
java.util.ArrayList |
getChildrenList(short[] nodeTypes)
Gets all the child nodes of the given types.
|
java.util.ArrayList |
getChildrenList(short[] nodeTypes,
java.lang.String childName)
Gets the child nodes of the given types and node name.
|
java.util.ArrayList |
getChildrenList(java.lang.String childName)
Gets the child elements of the given node name.
|
java.lang.String |
getElementName()
Retrieves the node name of the element as a string.
|
java.lang.String |
getLocalName() |
java.lang.String |
getNamespaceURI() |
java.lang.String |
getNodeName() |
short |
getNodeType() |
java.lang.String |
getNodeValue() |
org.w3c.dom.Document |
getOwnerDocument() |
java.util.Vector |
getSimilarChildren(java.lang.String childName)
Gets the child elements with node names "similar to" the given node name
(i.e.
|
java.util.ArrayList |
getSimilarChildrenList(java.lang.String childName)
Gets the child elements with node names "similar to" the given node name
(i.e.
|
java.lang.String |
getTagName() |
boolean |
isJSON() |
java.util.Hashtable |
loadProperties()
Loads the Jbo Properties
|
java.util.HashMap |
loadPropertiesMap()
Loads the Jbo Properties
|
java.util.Hashtable |
loadTable(java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value) |
java.util.HashMap |
loadTableMap(java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value) |
java.util.List<java.util.List<java.lang.String>> |
read2DStringArray(java.lang.String parentName,
java.lang.String firstElement,
java.lang.String secondElement)
This method reads a 2D hierarchical element structure from under the parent element into
a list of list of strings
The element structure that is read into the 2D list looks like:
|
boolean |
readBoolean(java.lang.String attrName)
Given the Object name and Attribute name loads that attribute
|
boolean |
readBoolean(java.lang.String attrName,
boolean bDefault)
Given the Object name and Attribute name loads that attribute
|
java.lang.String |
readCDataObject(java.lang.String attrName) |
java.lang.Class |
readClassName(java.lang.String attrName) |
int |
readInt(java.lang.String attrName)
Given the Object name and Attribute name loads that attribute
and returns the int value.
|
int |
readInt(java.lang.String attrName,
int defValue)
Given the Object name and Attribute name loads that attribute
|
long |
readLong(java.lang.String attrName)
Given the Object name and Attribute name loads that attribute
|
java.lang.String |
readString(java.lang.String attrName)
Given the Object name and Attribute name loads that attribute
|
java.lang.String |
readString(java.lang.String attrName,
java.lang.String defValue)
Given the Object name and Attribute name loads that attribute
|
java.util.Vector |
readStringArray(java.lang.String attrName)
Given the Attribute name loads the array
|
java.util.ArrayList |
readStringArrayList(java.lang.String attrName)
Given the Attribute name loads the array
|
java.util.ArrayList |
readStringArrayListElement(java.lang.String attrName)
Given the Attribute name loads the array
|
java.util.ArrayList |
readStringList(java.lang.String attrName)
Given the Attribute name loads the array
For JSON, this will save a simple list of strings instead
of the more complex xml element structure.
|
java.lang.String |
readUserNodeValue(java.lang.String attrName)
Given the Object name and Attribute name loads that attribute
|
java.lang.String |
readUserObject(java.lang.String attrName) |
java.lang.String |
readUserObject(java.lang.String attrName,
boolean checkUnique) |
java.lang.String |
readUserObjectTrim(java.lang.String attrName) |
java.lang.String |
readUserObjectTrim(java.lang.String attrName,
boolean checkUnique) |
java.util.ArrayList |
readUserStringArrayListElement(java.lang.String elemName)
Given the Attribute name loads the array
|
java.util.HashMap |
readUserStringElementsMap(java.lang.String elemName)
Given the Attribute name loads the map of name-value pairs wher value is CData strings
|
void |
removeAttribute(java.lang.String param1) |
void |
setAttribute(java.lang.String param1,
java.lang.String param2) |
@Restricted public JSONElementImpl(java.lang.String tagName)
public JSONElementImpl(JsonNodeWrapper node, java.lang.String tagName)
public JSONElementImpl(JSONElementImpl parent, JsonNodeWrapper node, java.lang.String tagName)
public static JSONElementImpl createJSONElement(java.io.Reader reader, java.lang.String xmlTag)
public boolean isJSON()
isJSON in interface DefElementpublic java.lang.String getElementName()
getElementName in interface DefElementpublic java.lang.String getTagName()
getTagName in interface DefElementpublic java.lang.String getNodeName()
getNodeName in interface DefNodepublic org.w3c.dom.Document getOwnerDocument()
getOwnerDocument in interface DefElementpublic java.util.Vector getChildren(java.lang.String childName)
getChildren in interface DefElementchildName - the node name of the child - null indicates all names.public JSONElementImpl getChildElement(java.lang.String childName)
public DefElement findChildElement(java.lang.String childName)
findChildElement in interface DefElementchildName - the node name of the child - null indicates all names.public java.util.ArrayList getChildrenList()
getChildrenList in interface DefElementprotected java.util.ArrayList getChildrenList(JsonNodeWrapper jsonNode)
protected void fillListFromArrayNode(ArrayNodeWrapper node, java.lang.String fldName, java.util.ArrayList list)
public java.util.ArrayList getChildrenList(short[] nodeTypes)
getChildrenList in interface DefElementnodeTypes - the types of nodes to be retrieved. Notes:
(1) Only ELEMENT_NODE, TEXT_NODE, and
CDATA_SECTION_NODE are currently supported.
(2) The order in which node types are listed
has no effect, even on performance.public java.util.ArrayList getChildrenList(java.lang.String childName)
getChildrenList in interface DefElementchildName - the node name of the child - null indicates all names.public java.util.ArrayList getChildrenList(short[] nodeTypes,
java.lang.String childName)
getChildrenList in interface DefElementnodeTypes - the types of nodes to be retrieved. Notes:
(1) Only ELEMENT_NODE, TEXT_NODE, and
CDATA_SECTION_NODE are currently supported.
(2) The order in which node types are listed
has no effect, even on performance.childName - the node name of the child - null indicates all names.public java.util.Vector getSimilarChildren(java.lang.String childName)
getSimilarChildren in interface DefElementchildName - the substring within node name of the child.public java.util.ArrayList getSimilarChildrenList(java.lang.String childName)
getSimilarChildrenList in interface DefElementchildName - the substring within node name of the child.public java.util.ArrayList getAttrsList()
getAttrsList in interface DefElementpublic java.lang.String getNodeValue()
getNodeValue in interface DefNodepublic int readInt(java.lang.String attrName)
readInt in interface DefElementattrName - Name of the Attributepublic int readInt(java.lang.String attrName,
int defValue)
DefElementreadInt in interface DefElementattrName - Name of the AttributedefValue - Default value of the Attributepublic long readLong(java.lang.String attrName)
readLong in interface DefElementattrName - Name of the Attributepublic boolean readBoolean(java.lang.String attrName)
readBoolean in interface DefElementattrName - Name of the Attributepublic boolean readBoolean(java.lang.String attrName,
boolean bDefault)
DefElementreadBoolean in interface DefElementattrName - Name of the AttributebDefault - Default value of the Attributepublic java.lang.String readString(java.lang.String attrName)
readString in interface DefElementattrName - Name of the Attributepublic java.lang.String readString(java.lang.String attrName,
java.lang.String defValue)
DefElementreadString in interface DefElementattrName - Name of the Attributepublic java.lang.String getAttribute(java.lang.String param1)
getAttribute in interface DefElementpublic java.lang.String readCDataObject(java.lang.String attrName)
readCDataObject in interface DefElementpublic java.lang.String readUserObject(java.lang.String attrName)
readUserObject in interface DefElementpublic java.lang.String readUserObject(java.lang.String attrName,
boolean checkUnique)
readUserObject in interface DefElementpublic java.lang.String readUserObjectTrim(java.lang.String attrName)
readUserObjectTrim in interface DefElementpublic java.lang.String readUserObjectTrim(java.lang.String attrName,
boolean checkUnique)
readUserObjectTrim in interface DefElementpublic java.lang.String readUserNodeValue(java.lang.String attrName)
readUserNodeValue in interface DefElementattrName - Name of the Attributepublic java.util.Vector readStringArray(java.lang.String attrName)
readStringArray in interface DefElementattrName - Name of the Attributepublic java.util.ArrayList readStringArrayList(java.lang.String attrName)
readStringArrayList in interface DefElementattrName - Name of the Attributepublic java.util.ArrayList readStringArrayListElement(java.lang.String attrName)
readStringArrayListElement in interface DefElementattrName - Name of the Attributepublic java.util.ArrayList readStringList(java.lang.String attrName)
DefElementreadStringList in interface DefElementattrName - Name of the Attributepublic java.util.ArrayList readUserStringArrayListElement(java.lang.String elemName)
readUserStringArrayListElement in interface DefElementelemName - Name of the child element that is a list of CData stringspublic java.util.HashMap readUserStringElementsMap(java.lang.String elemName)
readUserStringElementsMap in interface DefElementelemName - Name of the child element that is a list of CData stringspublic java.lang.Class readClassName(java.lang.String attrName)
readClassName in interface DefElementpublic java.util.Hashtable loadProperties()
loadProperties in interface DefElementpublic java.util.HashMap loadPropertiesMap()
loadPropertiesMap in interface DefElementpublic java.util.Hashtable loadTable(java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value)
loadTable in interface DefElementpublic java.util.HashMap loadTableMap(java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value)
loadTableMap in interface DefElementpublic java.util.List<java.util.List<java.lang.String>> read2DStringArray(java.lang.String parentName,
java.lang.String firstElement,
java.lang.String secondElement)
DefElementread2DStringArray in interface DefElementparentName - - Name of the parent element under which this 2D structure is presentfirstElement - - Name of the first level elementsecondElement - - Name of the second level elementpublic void setAttribute(java.lang.String param1,
java.lang.String param2)
setAttribute in interface DefElementpublic void removeAttribute(java.lang.String param1)
removeAttribute in interface DefElementpublic org.w3c.dom.NamedNodeMap getAttributes()
getAttributes in interface DefElementpublic org.w3c.dom.NodeList getChildNodes()
getChildNodes in interface DefElementpublic org.w3c.dom.NodeList getChildrenByTagName(java.lang.String param1)
getChildrenByTagName in interface DefElementpublic org.w3c.dom.NodeList getChildrenByTagName(java.lang.String param1,
java.lang.String param2)
getChildrenByTagName in interface DefElementpublic java.lang.String getLocalName()
getLocalName in interface DefNodepublic java.lang.String getNamespaceURI()
getNamespaceURI in interface DefNodepublic short getNodeType()
getNodeType in interface DefNode