org.apache.servicemix.soap.util
Class DomUtil

java.lang.Object
  extended by org.apache.servicemix.soap.util.DomUtil

public class DomUtil
extends java.lang.Object

DOM related utilities.

Author:
Guillaume Nodet

Constructor Summary
DomUtil()
           
 
Method Summary
static org.w3c.dom.Document createDocument()
           
static org.w3c.dom.Element createElement(org.w3c.dom.Node parent, javax.xml.namespace.QName name)
           
static javax.xml.namespace.QName createQName(org.w3c.dom.Element element, java.lang.String qualifiedName)
          Creates a QName instance from the given namespace context for the given qualifiedName
static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
          Returns a cached DocumentBuilder instance - should only be used for methods that are considered thread-safe (e.g.
static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
           
static java.lang.String getElementText(org.w3c.dom.Element element)
          Returns the text of the element
static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent)
          Get the first child element
static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Element el)
          Get the next sibling element
static javax.xml.namespace.QName getQName(org.w3c.dom.Element el)
           
static javax.xml.transform.TransformerFactory getTransformerFactory()
           
protected static java.lang.String getUniquePrefix(org.w3c.dom.Element element)
           
static org.w3c.dom.Document parse(java.io.InputStream is)
           
static org.w3c.dom.Document parse(javax.xml.transform.Source source)
           
static java.lang.String recursiveGetAttributeValue(org.w3c.dom.Node parent, java.lang.String attributeName)
          Recursive method to find a given attribute value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomUtil

public DomUtil()
Method Detail

createDocument

public static org.w3c.dom.Document createDocument()

parse

public static org.w3c.dom.Document parse(java.io.InputStream is)

parse

public static org.w3c.dom.Document parse(javax.xml.transform.Source source)

getDocumentBuilderFactory

public static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()

getDocumentBuilder

public static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
                                                            throws javax.xml.parsers.ParserConfigurationException
Returns a cached DocumentBuilder instance - should only be used for methods that are considered thread-safe (e.g. DocumentBuilder.newDocument())

Throws:
javax.xml.parsers.ParserConfigurationException

getTransformerFactory

public static javax.xml.transform.TransformerFactory getTransformerFactory()

getFirstChildElement

public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent)
Get the first child element

Parameters:
parent -
Returns:

getElementText

public static java.lang.String getElementText(org.w3c.dom.Element element)
Returns the text of the element


getNextSiblingElement

public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Element el)
Get the next sibling element

Parameters:
el -
Returns:

createElement

public static org.w3c.dom.Element createElement(org.w3c.dom.Node parent,
                                                javax.xml.namespace.QName name)

createQName

public static javax.xml.namespace.QName createQName(org.w3c.dom.Element element,
                                                    java.lang.String qualifiedName)
Creates a QName instance from the given namespace context for the given qualifiedName

Parameters:
element - the element to use as the namespace context
qualifiedName - the fully qualified name
Returns:
the QName which matches the qualifiedName

recursiveGetAttributeValue

public static java.lang.String recursiveGetAttributeValue(org.w3c.dom.Node parent,
                                                          java.lang.String attributeName)
Recursive method to find a given attribute value


getUniquePrefix

protected static java.lang.String getUniquePrefix(org.w3c.dom.Element element)

getQName

public static javax.xml.namespace.QName getQName(org.w3c.dom.Element el)


Copyright © 2005-2015 FuseSource. All Rights Reserved.