util
Class DomHelpers

java.lang.Object
  extended by util.DomHelpers

public class DomHelpers
extends Object

Some helpers to handle org.w3c.* stuff...

Since:
0.1.4
Author:
aw

Constructor Summary
DomHelpers()
           
 
Method Summary
static void addAttribute(Element el, String name, String val)
           
static void addXmlNamespaceDeclarations(NamespaceDeclarationHolder nsh, Element to)
           
static Element createNonNsElement(Document doc, String name)
           
static Document deepCopy(Element child)
          Makes a deep-copy of an Element instance and appends it to a new Document instance as child.
static boolean elementMatches(Element el, String elname)
           
static boolean elementMatches(Element e, String name, String uri)
           
static Element findElementInChildren(Node node, String name, String uri)
           
static List<Element> getChildElements(Element e)
          Create a new list containing only the child nodes of e of type Element.
static String makeRequestFQName(String name)
           
static DocumentBuilder newDocumentBuilder()
           
static InputStream toInputStream(Document doc)
          Marshal a Document to InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomHelpers

public DomHelpers()
Method Detail

newDocumentBuilder

public static final DocumentBuilder newDocumentBuilder()

createNonNsElement

public static final Element createNonNsElement(Document doc,
                                               String name)

addAttribute

public static final void addAttribute(Element el,
                                      String name,
                                      String val)

addXmlNamespaceDeclarations

public static final void addXmlNamespaceDeclarations(NamespaceDeclarationHolder nsh,
                                                     Element to)

makeRequestFQName

public static final String makeRequestFQName(String name)

elementMatches

public static final boolean elementMatches(Element el,
                                           String elname)

elementMatches

public static final boolean elementMatches(Element e,
                                           String name,
                                           String uri)

getChildElements

public static final List<Element> getChildElements(Element e)
Create a new list containing only the child nodes of e of type Element.

Parameters:
e -
Returns:

findElementInChildren

public static final Element findElementInChildren(Node node,
                                                  String name,
                                                  String uri)

deepCopy

public static final Document deepCopy(Element child)
Makes a deep-copy of an Element instance and appends it to a new Document instance as child.

Parameters:
child - the Element instnace to be deep-copied
Returns:
a new Document instance with a deep-copied child appended

toInputStream

public static final InputStream toInputStream(Document doc)
                                       throws MarshalException
Marshal a Document to InputStream.

Parameters:
doc -
Returns:
Throws:
MarshalException


Copyright © 2012 Trust@FHH. All Rights Reserved.