|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sfm.ap210.jsdai.utils.DomUtils
public abstract class DomUtils
Generic utility methods and helpers for dealing with DOM data
| Constructor Summary | |
|---|---|
DomUtils()
|
|
| Method Summary | ||
|---|---|---|
static java.lang.Iterable<org.w3c.dom.Element> |
Children(org.w3c.dom.Element element)
Get all child elements of the given element |
|
static java.lang.Iterable<org.w3c.dom.Element> |
Children(org.w3c.dom.Node node,
java.lang.String tag)
Get all child elements of the given node with the given tag |
|
static java.lang.Iterable<org.w3c.dom.Element> |
Descendents(org.w3c.dom.Element root,
java.lang.String tag)
Get all descendent elements of the given node with the given tag |
|
static java.lang.Iterable<org.w3c.dom.Element> |
Elements(org.w3c.dom.Document dom,
java.lang.String tag)
Get all elements of the given document with the given tag |
|
static org.w3c.dom.Element |
FirstDescendent(org.w3c.dom.Element root,
java.lang.String tag)
Get the first descendent node of the given element with the given tag |
|
static org.w3c.dom.Element |
FirstElement(org.w3c.dom.Document dom,
java.lang.String tag)
Get the first element in the given docuemnt with the given tag |
|
static org.w3c.dom.Document |
loadXML(java.io.File file)
Load an XML file into a DOM structure from file |
|
static org.w3c.dom.Document |
newDocument(java.lang.String root)
Create a new DOM instance with the given root node |
|
static java.lang.Iterable<org.w3c.dom.Node> |
NodeSequence(org.w3c.dom.NodeList nodes)
Obtain an iterable view of the given NodeList |
|
static java.util.List<org.w3c.dom.Element> |
Parents(org.w3c.dom.Element elem,
java.lang.String tag)
Get the parent elements of the given element with the given tag |
|
static
|
Sequence(org.w3c.dom.NodeList nodes)
Return an iterable view of the given NodeList with items of the given type |
|
static void |
writeXML(org.w3c.dom.Document xml,
java.io.File file)
Write the DOM document to the provided file |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DomUtils()
| Method Detail |
|---|
public static java.lang.Iterable<org.w3c.dom.Node> NodeSequence(org.w3c.dom.NodeList nodes)
nodes -
public static <T> java.lang.Iterable<T> Sequence(org.w3c.dom.NodeList nodes)
T - nodes -
public static java.lang.Iterable<org.w3c.dom.Element> Elements(org.w3c.dom.Document dom,
java.lang.String tag)
dom - tag -
public static java.lang.Iterable<org.w3c.dom.Element> Children(org.w3c.dom.Element element)
element -
public static java.lang.Iterable<org.w3c.dom.Element> Children(org.w3c.dom.Node node,
java.lang.String tag)
node - tag -
public static java.lang.Iterable<org.w3c.dom.Element> Descendents(org.w3c.dom.Element root,
java.lang.String tag)
root - tag -
public static org.w3c.dom.Element FirstDescendent(org.w3c.dom.Element root,
java.lang.String tag)
root - tag -
public static org.w3c.dom.Element FirstElement(org.w3c.dom.Document dom,
java.lang.String tag)
dom - tag -
public static java.util.List<org.w3c.dom.Element> Parents(org.w3c.dom.Element elem,
java.lang.String tag)
elem - tag -
public static org.w3c.dom.Document loadXML(java.io.File file)
throws org.xml.sax.SAXException,
java.io.IOException
file -
org.xml.sax.SAXException
java.io.IOExceptionpublic static org.w3c.dom.Document newDocument(java.lang.String root)
root -
public static void writeXML(org.w3c.dom.Document xml,
java.io.File file)
throws java.io.IOException
xml - file -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||