SMILA 1.0 API documentation

org.eclipse.smila.utils.xml
Class XmlHelper

java.lang.Object
  extended by org.eclipse.smila.utils.xml.XmlHelper

public final class XmlHelper
extends java.lang.Object

The Class XmlHelper.


Field Summary
static javax.xml.parsers.DocumentBuilderFactory BUILDING_FACTORY
          The BUILDING factory.
static javax.xml.transform.TransformerFactory TRANSFORMER_FACTORY
          The Constant TRANSFORMER_FACTORY.
static java.lang.String XML_HEADER_UTF8
          The Constant XML_HEADER_UTF8.
 
Method Summary
static org.w3c.dom.Element createElement(org.w3c.dom.Node parent, java.lang.String nodeName)
          Creates the element.
static org.w3c.dom.Text createText(org.w3c.dom.Node parent, java.lang.String text)
          Creates the text.
static org.w3c.dom.Document newDocument()
          New document.
static org.w3c.dom.Document newDocument(java.lang.String rootName)
          New document.
static org.w3c.dom.Document parse(byte[] input)
          Parses the.
static org.w3c.dom.Document parse(java.lang.String input)
          Parses the.
static byte[] toByteArray(org.w3c.dom.Document document)
          To byte array.
static java.lang.String toString(org.w3c.dom.Document document)
          To string.
static java.lang.String toString(org.w3c.dom.Document document, boolean xmlDeclaration)
          To string.
static void transform(org.w3c.dom.Document document, javax.xml.transform.stream.StreamResult streamResult, boolean xmlDeclaration)
          Transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILDING_FACTORY

public static final javax.xml.parsers.DocumentBuilderFactory BUILDING_FACTORY
The BUILDING factory.


TRANSFORMER_FACTORY

public static final javax.xml.transform.TransformerFactory TRANSFORMER_FACTORY
The Constant TRANSFORMER_FACTORY.


XML_HEADER_UTF8

public static final java.lang.String XML_HEADER_UTF8
The Constant XML_HEADER_UTF8.

See Also:
Constant Field Values
Method Detail

toString

public static java.lang.String toString(org.w3c.dom.Document document)
To string.

Parameters:
document - the document
Returns:
the string

toString

public static java.lang.String toString(org.w3c.dom.Document document,
                                        boolean xmlDeclaration)
To string.

Parameters:
document - the document
xmlDeclaration - the xml declaration
Returns:
the string

toByteArray

public static byte[] toByteArray(org.w3c.dom.Document document)
To byte array.

Parameters:
document - the document
Returns:
the byte[]

transform

public static void transform(org.w3c.dom.Document document,
                             javax.xml.transform.stream.StreamResult streamResult,
                             boolean xmlDeclaration)
Transform.

Parameters:
document - the document
streamResult - the stream result
xmlDeclaration - the xml declaration

parse

public static org.w3c.dom.Document parse(java.lang.String input)
                                  throws java.io.IOException,
                                         javax.xml.parsers.ParserConfigurationException,
                                         org.xml.sax.SAXException
Parses the.

Parameters:
input - the input
Returns:
the document
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
javax.xml.parsers.ParserConfigurationException - the parser configuration exception
org.xml.sax.SAXException - the SAX exception

parse

public static org.w3c.dom.Document parse(byte[] input)
                                  throws java.io.IOException,
                                         javax.xml.parsers.ParserConfigurationException,
                                         org.xml.sax.SAXException
Parses the.

Parameters:
input - the input
Returns:
the document
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
javax.xml.parsers.ParserConfigurationException - the parser configuration exception
org.xml.sax.SAXException - the SAX exception

newDocument

public static org.w3c.dom.Document newDocument()
                                        throws javax.xml.parsers.ParserConfigurationException
New document.

Returns:
the document
Throws:
javax.xml.parsers.ParserConfigurationException - the parser configuration exception

newDocument

public static org.w3c.dom.Document newDocument(java.lang.String rootName)
                                        throws javax.xml.parsers.ParserConfigurationException
New document.

Parameters:
rootName - the root name
Returns:
the document
Throws:
javax.xml.parsers.ParserConfigurationException - the parser configuration exception

createElement

public static org.w3c.dom.Element createElement(org.w3c.dom.Node parent,
                                                java.lang.String nodeName)
Creates the element.

Parameters:
parent - the parent
nodeName - the node name
Returns:
the element

createText

public static org.w3c.dom.Text createText(org.w3c.dom.Node parent,
                                          java.lang.String text)
Creates the text.

Parameters:
parent - the parent
text - the text
Returns:
the text

SMILA 1.0 API documentation