|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ebmwebsourcing.easycommons.xml.XMLHelper
public final class XMLHelper
Utilities methods for XML operations
| Constructor Summary | |
|---|---|
XMLHelper()
|
|
| Method Summary | |
|---|---|
static Document |
createDocumentFromString(String xml)
Create a DOM document from the specified XML string |
static String |
createStringFromDOMDocument(Node document)
Create a String result from a DOM document |
static String |
createStringFromDOMNode(Node node)
Create a String result from a DOM Node |
static String |
createStringFromDOMNode(Node node,
boolean omitDeclaration)
Create a String result from a DOM Node |
static Node |
findChild(Node parentNode,
String namespaceURI,
String nodeName,
boolean recursive)
Search for the first child of the specified parent node with the specified namespace URI and local name. |
static String |
toString(NodeList list)
Create a String from a Node list |
static void |
writeDocument(Document document,
OutputStream outputStream)
Write a document to an output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLHelper()
| Method Detail |
|---|
public static final String toString(NodeList list)
String from a Node list
list - a node list
public static final String createStringFromDOMDocument(Node document)
throws TransformerException
document - the DOM Document. It cannot be null
TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final String createStringFromDOMNode(Node node)
throws TransformerException
node - the DOM Node. It cannot be null
TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final String createStringFromDOMNode(Node node,
boolean omitDeclaration)
throws TransformerException
node - the DOM Node. It cannot be nullomitDeclaration - a flag to indicate to omit the XML declaration
TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final void writeDocument(Document document,
OutputStream outputStream)
throws TransformerException
document - the document to write to the output streamoutputStream - the output stream to write the document
TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final Document createDocumentFromString(String xml)
throws SAXException,
IOException
xml - a XML string
IOException - If any IO errors occur
SAXException - If any parse errors occur
PoolException - This method uses a document builder got from a document
builder pool. This unchecked exception is thrown if the
current thread waits for a document builder of the pool and
is interrupted (as the pool policy is WAIT)
public static final Node findChild(Node parentNode,
String namespaceURI,
String nodeName,
boolean recursive)
parentNode - a parent nodenamespaceURI - the namespace URI of the node to search. if null, the namespace
is ignorednodeName - the local name of the node to searchrecursive - a flag to know the search is recursive in the XML tree
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||