public class XMLUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
XML_INDENT_CHAR |
| Constructor and Description |
|---|
XMLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendBytesToFile(byte[] data,
java.io.File filepath)
Write XML to the file
|
static org.jdom2.Document |
convertBytesToDocument(byte[] byteData)
Convert Bytes to Document object
|
static org.jdom2.Element |
convertBytesToElement(byte[] byteData) |
static byte[] |
convertDocumentToBytes(org.jdom2.Document doc)
Convert Document to byte array
|
static byte[] |
convertElementToBytes(org.jdom2.Element elem) |
static java.lang.String |
convertElementToString(org.jdom2.Element elem) |
static org.jdom2.Document |
convertXMLStringToDocument(java.lang.String xmlStr,
java.lang.String encoding)
Convert XML string to document object to process fixed data.
|
static java.util.List |
copyContent(org.jdom2.Element parentElem)
Will copy the content of an Element.
|
static org.jdom2.Document |
getResourceAsDocument(java.lang.String resource) |
static byte[] |
prettyPrintXML(byte[] xml) |
static java.lang.String |
prettyPrintXML(org.jdom2.Element element)
Pretty print a single element.
|
static byte[] |
readBinaryData(java.io.InputStream input) |
static byte[] |
readXMLFileToBytes(java.lang.String filepath)
Read XML file to process data.
|
static org.jdom2.Document |
readXMLFileToDocument(java.lang.String filepath)
Read XML file to process data.
|
static void |
writeBytesToXMLFile(byte[] in,
java.io.File filepath,
boolean prettyPrint)
Write XML to the file
|
static void |
writeBytesToXMLFile(byte[] in,
java.lang.String filepath)
Write all XML records to the file
|
static void |
writeBytesToXMLFile(byte[] in,
java.lang.String filepath,
boolean prettyPrint)
Write XML to the file
|
static void |
writeBytesToXMLFile(byte[] in,
java.lang.String filepath,
java.lang.String top)
Deprecated.
|
static void |
writeDocumentToXMLFile(org.jdom2.Document doc,
java.lang.String filepath) |
static void |
writeDocumentToXMLFile(org.jdom2.Document doc,
java.lang.String filepath,
java.lang.String filebackup)
Deprecated.
|
public static final java.lang.String XML_INDENT_CHAR
public static java.util.List copyContent(org.jdom2.Element parentElem)
parentElem - public static byte[] readXMLFileToBytes(java.lang.String filepath)
throws MXException
filepath - Give path of the file.MXSystemException - MAXIMO exceptionMXExceptionpublic static byte[] convertElementToBytes(org.jdom2.Element elem)
throws MXException
MXExceptionpublic static java.lang.String convertElementToString(org.jdom2.Element elem)
throws MXException
MXExceptionpublic static org.jdom2.Element convertBytesToElement(byte[] byteData)
throws MXException
MXExceptionpublic static byte[] convertDocumentToBytes(org.jdom2.Document doc)
throws MXException
doc - Give reference to Document.MXSystemException - MAXIMO exceptionMXExceptionpublic static org.jdom2.Document getResourceAsDocument(java.lang.String resource)
throws java.lang.Exception
java.lang.Exceptionpublic static org.jdom2.Document readXMLFileToDocument(java.lang.String filepath)
throws MXException
filepath - Give path of the file.MXSystemException - MAXIMO exceptionMXExceptionpublic static org.jdom2.Document convertBytesToDocument(byte[] byteData)
throws MXException
byteData - Give path of the file.MXSystemException - MAXIMO exceptionMXExceptionpublic static org.jdom2.Document convertXMLStringToDocument(java.lang.String xmlStr,
java.lang.String encoding)
throws MXException
xmlStr - The XML in text format.encoding - The encoding.MXApplicationException - MAXIMO exceptionMXException@Deprecated
public static void writeDocumentToXMLFile(org.jdom2.Document doc,
java.lang.String filepath,
java.lang.String filebackup)
throws MXException
in - Give reference to values object.filepath - Give path of the file.filebackup - Give path of the buckup file.top - Give name of top level.MXException - MAXIMO exceptionpublic static void writeDocumentToXMLFile(org.jdom2.Document doc,
java.lang.String filepath)
throws MXException
MXException@Deprecated
public static void writeBytesToXMLFile(byte[] in,
java.lang.String filepath,
java.lang.String top)
throws MXException
in - Give reference to values object.filepath - Give path of the file.top - Give name of top level.MXException - MAXIMO exceptionpublic static byte[] prettyPrintXML(byte[] xml)
throws MXException
MXExceptionpublic static void writeBytesToXMLFile(byte[] in,
java.lang.String filepath)
throws MXException
in - Give reference to values object.filepath - Give path of the file.MXException - MAXIMO exceptionpublic static void writeBytesToXMLFile(byte[] in,
java.io.File filepath,
boolean prettyPrint)
throws MXException
in - Give reference to values object.filepath - Give path of the file, includes the file name.prettyPrint - When set, formats the file for reading by people.MXExceptionpublic static void writeBytesToXMLFile(byte[] in,
java.lang.String filepath,
boolean prettyPrint)
throws MXException
in - Give reference to values object.filepath - Give path of the file, includes the file name.prettyPrint - When set, formats the file for reading by people.MXExceptionpublic static java.lang.String prettyPrintXML(org.jdom2.Element element)
throws MXException
MXExceptionpublic static byte[] readBinaryData(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic static void appendBytesToFile(byte[] data,
java.io.File filepath)
throws MXException
in - Give reference to values object.filepath - Give path of the file, includes the file name.prettyPrint - When set, formats the file for reading by people.MXException