|
AdventNet Web NMS 4 DMS API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.nms.extranet.utils.common.XmlParseUtil
Utility class providing basic methods for XML customization. Provides methods for creating node from the properties, retrieving the properties from the element node etc.
| Constructor Summary | |
XmlParseUtil()
|
|
| Method Summary | |
static org.w3c.dom.Element |
createDocElement(org.w3c.dom.Element elt)
Creates a new Document and appends the given element to the document. |
static org.w3c.dom.Document |
createNewDocument()
Creates a new Document from the DocBuilder and Factory |
static org.w3c.dom.Element |
createNode(org.w3c.dom.Document doc,
java.util.Properties prop,
java.lang.String name)
Creates the XML Element with the given tag name and the properties as attributes of the node with doc as additional property. |
static org.w3c.dom.Element |
createNode(java.util.Properties prop,
java.lang.String name)
Creates the XML Element with the given tag name and the properties as attributes of the node. |
static org.w3c.dom.Element |
createNodeFromProperties(org.w3c.dom.Document doc,
java.util.Properties prop,
java.lang.String tag)
Creates the XML sub-elements with the given properties under the tag name as that of the given name. |
static org.w3c.dom.Element |
createNodeFromProperties(java.util.Properties prop,
java.lang.String tag)
Creates the XML Element with the given properties under the tag name as that of the given name. |
static byte[] |
getBytes(org.w3c.dom.Element root)
This method will return a byte array for the given XML element. |
static java.lang.String |
getDTDName(java.io.File file)
|
static org.w3c.dom.Element |
getElement(byte[] b)
This method will return a XML element for the given byte array. |
static org.w3c.dom.Element |
getFirstChild(org.w3c.dom.Element elt)
For a given Element node this method will return the first Element child node |
static org.w3c.dom.Element |
getLastChild(org.w3c.dom.Element elt)
For a given Element node this method will return the last Element child node |
static java.util.Properties |
getProperties(org.w3c.dom.Element resultNode)
Provided an Element node which is having its attributes set,this method will return the attributes in Properties. |
static org.w3c.dom.Element |
getXmlDocument(java.io.File file)
For the given XML file,the Root Element node is returned |
static org.w3c.dom.Element |
getXmlDocument(java.io.File file,
boolean validating)
For the given XML file,the Root Element node is returned |
static java.util.Properties |
loadAttributes(org.w3c.dom.Element currNode)
This method will return a Properties object formed from the attributes of the given XML element. |
static void |
saveDocument(org.apache.crimson.tree.XmlDocument doc,
java.io.File f,
java.lang.String encoding,
java.lang.String dtdName)
This method will save the given file, with the given encoding, dtd name and the XmlDocument with proper indentation. |
static void |
saveDocument(org.apache.crimson.tree.XmlDocument doc,
java.lang.String fileName)
This method will save the XmlDocument in a file with the name, as that of the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlParseUtil()
| Method Detail |
public static java.util.Properties loadAttributes(org.w3c.dom.Element currNode)
currNode - XML element whose attributes are used to construct the Properties
public static org.w3c.dom.Element createNode(java.util.Properties prop,
java.lang.String name)
prop - Properties to be set as attributes for the XML nodename - Name of the tag for the Element Node created
public static org.w3c.dom.Element createNode(org.w3c.dom.Document doc,
java.util.Properties prop,
java.lang.String name)
doc - XML Document from which the Element is createdprop - Properties to be set as attributes for the XML nodename - Name of the tag for the Element node createdpublic static java.util.Properties getProperties(org.w3c.dom.Element resultNode)
resultNode - the element node from which properties need to be extracted
public static org.w3c.dom.Element createNodeFromProperties(java.util.Properties prop,
java.lang.String tag)
prop - Properties for forming the XML nodename - Name of the tag for Element node created
public static org.w3c.dom.Element createNodeFromProperties(org.w3c.dom.Document doc,
java.util.Properties prop,
java.lang.String tag)
doc - Document from which Element can be createdprop - Properties for forming the XML nodename - Name of the tag for the Element node createdpublic static org.w3c.dom.Document createNewDocument()
public static org.w3c.dom.Element createDocElement(org.w3c.dom.Element elt)
elt - XML element which needs to be appended to the document
public static byte[] getBytes(org.w3c.dom.Element root)
throws java.lang.Exception
public static org.w3c.dom.Element getXmlDocument(java.io.File file)
throws java.lang.Exception
file, - the XML file for which the root element node is requiredjava.lang.Exception -
public static org.w3c.dom.Element getXmlDocument(java.io.File file,
boolean validating)
throws java.lang.Exception
file, - the XML file for which the root element node is requiredvalidating - a boolean to specify whether the DTD validation is required or notjava.lang.Exception - public static org.w3c.dom.Element getFirstChild(org.w3c.dom.Element elt)
elt - Element for which first Childnode is requiredpublic static org.w3c.dom.Element getLastChild(org.w3c.dom.Element elt)
elt - Element for which last Childnode is requiredpublic static org.w3c.dom.Element getElement(byte[] b)
public static void saveDocument(org.apache.crimson.tree.XmlDocument doc,
java.io.File f,
java.lang.String encoding,
java.lang.String dtdName)
doc - XmlDocument which is to be written in a file.file - File in which the XmlDocument, encoding, dtd need to be written.encoding - a String value representing the encoding format such as "UTF-8".dtdName - a String value representing the dtdName, which contains the validation for this XML file.
public static void saveDocument(org.apache.crimson.tree.XmlDocument doc,
java.lang.String fileName)
doc - XmlDocument which is to be written in a file.fileName - a String specifying the name of the file.
NOTE: This method is only for internal usage
public static java.lang.String getDTDName(java.io.File file)
throws java.lang.Exception
|
AdventNet Web NMS 4 DMS API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||