intarsys runtime library

de.intarsys.tools.dom
Class DOMTools

java.lang.Object
  extended by de.intarsys.tools.dom.DOMTools

public class DOMTools
extends Object


Field Summary
static Element[] NO_ELEMENTS
           
 
Method Summary
static Iterator<Attr> getAttributeIterator(Element element)
           
static int getAttrInt(Element elem, String name, int defaultValue)
           
static String getAttrString(Element elem, String name, String defaultValue)
           
static Element getDirectChild(Element element, String name)
           
static Element[] getDirectChildren(Element element)
           
static Element[] getDirectChildren(Element element, String name)
           
static Element getElement(Document document, String name)
           
static Element getElement(Element element, String name)
           
static Iterator<Element> getElementIterator(Element element)
           
static Iterator<Element> getElementIterator(Element element, String name)
           
static Element[] getElements(Element element)
           
static Element[] getElements(Element element, String name)
           
static Element getFirstDirectChild(Element element)
           
static Map<String,String> getNamespaceDeclarations(Element element)
          Scans all namespace declarations
static Element parseElement(byte[] value)
           
static Element parseElement(File file)
           
static Element parseElement(InputStream is, boolean close)
           
static Element parseElement(String value)
           
static Element[] toElementArray(NodeList nodes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ELEMENTS

public static final Element[] NO_ELEMENTS
Method Detail

getAttributeIterator

public static Iterator<Attr> getAttributeIterator(Element element)

getAttrInt

public static int getAttrInt(Element elem,
                             String name,
                             int defaultValue)

getAttrString

public static String getAttrString(Element elem,
                                   String name,
                                   String defaultValue)

getDirectChild

public static Element getDirectChild(Element element,
                                     String name)

getDirectChildren

public static Element[] getDirectChildren(Element element)

getDirectChildren

public static Element[] getDirectChildren(Element element,
                                          String name)

getElement

public static Element getElement(Document document,
                                 String name)

getElement

public static Element getElement(Element element,
                                 String name)

getElementIterator

public static Iterator<Element> getElementIterator(Element element)

getElementIterator

public static Iterator<Element> getElementIterator(Element element,
                                                   String name)

getElements

public static Element[] getElements(Element element)

getElements

public static Element[] getElements(Element element,
                                    String name)

getFirstDirectChild

public static Element getFirstDirectChild(Element element)

getNamespaceDeclarations

public static Map<String,String> getNamespaceDeclarations(Element element)
Scans all namespace declarations

Parameters:
element -
Returns:
All declared namespaces

parseElement

public static Element parseElement(byte[] value)
                            throws IOException,
                                   SAXException
Throws:
IOException
SAXException

parseElement

public static Element parseElement(File file)
                            throws IOException,
                                   SAXException
Throws:
IOException
SAXException

parseElement

public static Element parseElement(InputStream is,
                                   boolean close)
                            throws IOException,
                                   SAXException
Throws:
IOException
SAXException

parseElement

public static Element parseElement(String value)
                            throws IOException,
                                   SAXException
Throws:
IOException
SAXException

toElementArray

public static Element[] toElementArray(NodeList nodes)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.