|
Apache CXF API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cxf.helpers.DOMUtils
public final class DOMUtils
Few simple utils to read DOM. This is originally from the Jakarta Commons Modeler.
| Nested Class Summary | |
|---|---|
static class |
DOMUtils.NullResolver
|
| Method Summary | |
|---|---|
static org.w3c.dom.Document |
createDocument()
|
static javax.xml.parsers.DocumentBuilder |
createDocumentBuilder()
|
static java.lang.String |
createNamespace(org.w3c.dom.Element el,
java.lang.String ns)
|
static org.w3c.dom.Node |
findChildWithAtt(org.w3c.dom.Node parent,
java.lang.String elemName,
java.lang.String attName,
java.lang.String attVal)
Find the first direct child with a given attribute. |
static java.lang.String |
getAttribute(org.w3c.dom.Element element,
javax.xml.namespace.QName attName)
|
static java.lang.String |
getAttribute(org.w3c.dom.Node element,
java.lang.String attName)
|
static org.w3c.dom.Node |
getChild(org.w3c.dom.Node parent,
int type)
Get the first direct child with a given type |
static org.w3c.dom.Node |
getChild(org.w3c.dom.Node parent,
java.lang.String name)
Get the first element child. |
static java.lang.String |
getChildContent(org.w3c.dom.Node parent,
java.lang.String name)
Get the first child's content ( ie it's included TEXT node ). |
static java.lang.String |
getContent(org.w3c.dom.Node n)
Get the trimed text content of a node or null if there is no text |
static javax.xml.namespace.QName |
getElementQName(org.w3c.dom.Element el)
|
static org.w3c.dom.Element |
getFirstChildWithName(org.w3c.dom.Element parent,
javax.xml.namespace.QName q)
|
static org.w3c.dom.Element |
getFirstChildWithName(org.w3c.dom.Element parent,
java.lang.String ns,
java.lang.String lp)
|
static org.w3c.dom.Element |
getFirstElement(org.w3c.dom.Node parent)
Get the first direct child with a given type |
static java.lang.String |
getNamespace(org.w3c.dom.Element el,
java.lang.String searchPrefix)
Searches the given element including it's parent elements for a matching namspace decleration. |
static org.w3c.dom.Node |
getNext(org.w3c.dom.Node current)
Get the next sibling with the same name and type |
static org.w3c.dom.Node |
getNext(org.w3c.dom.Node current,
java.lang.String name,
int type)
Return the next sibling with a given name and type |
static java.lang.String |
getPrefix(org.w3c.dom.Element el,
java.lang.String ns)
|
static java.lang.String |
getPrefixRecursive(org.w3c.dom.Element el,
java.lang.String ns)
|
static java.lang.String |
getRawContent(org.w3c.dom.Node n)
Get the raw text content of a node or null if there is no text |
static org.w3c.dom.Document |
readXml(java.io.InputStream is)
Read XML as DOM. |
static org.w3c.dom.Document |
readXml(javax.xml.transform.stream.StreamSource is)
|
static void |
removeAttribute(org.w3c.dom.Node node,
java.lang.String attName)
|
static void |
setAttribute(org.w3c.dom.Node node,
java.lang.String attName,
java.lang.String val)
|
static void |
setText(org.w3c.dom.Node node,
java.lang.String val)
Set or replace the text value |
static void |
writeXml(org.w3c.dom.Node n,
java.io.OutputStream os)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String getContent(org.w3c.dom.Node n)
public static java.lang.String getRawContent(org.w3c.dom.Node n)
public static org.w3c.dom.Node getChild(org.w3c.dom.Node parent,
java.lang.String name)
parent - lookup direct childsname - name of the element. If null return the first element.
public static java.lang.String getAttribute(org.w3c.dom.Node element,
java.lang.String attName)
public static java.lang.String getAttribute(org.w3c.dom.Element element,
javax.xml.namespace.QName attName)
public static void setAttribute(org.w3c.dom.Node node,
java.lang.String attName,
java.lang.String val)
public static void removeAttribute(org.w3c.dom.Node node,
java.lang.String attName)
public static void setText(org.w3c.dom.Node node,
java.lang.String val)
public static org.w3c.dom.Node findChildWithAtt(org.w3c.dom.Node parent,
java.lang.String elemName,
java.lang.String attName,
java.lang.String attVal)
parent - elemName - name of the element, or null for anyattName - attribute we're looking forattVal - attribute value or null if we just want any
public static java.lang.String getChildContent(org.w3c.dom.Node parent,
java.lang.String name)
public static javax.xml.namespace.QName getElementQName(org.w3c.dom.Element el)
public static org.w3c.dom.Element getFirstElement(org.w3c.dom.Node parent)
public static org.w3c.dom.Element getFirstChildWithName(org.w3c.dom.Element parent,
javax.xml.namespace.QName q)
public static org.w3c.dom.Element getFirstChildWithName(org.w3c.dom.Element parent,
java.lang.String ns,
java.lang.String lp)
public static org.w3c.dom.Node getChild(org.w3c.dom.Node parent,
int type)
public static org.w3c.dom.Node getNext(org.w3c.dom.Node current)
public static org.w3c.dom.Node getNext(org.w3c.dom.Node current,
java.lang.String name,
int type)
public static org.w3c.dom.Document readXml(java.io.InputStream is)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document readXml(javax.xml.transform.stream.StreamSource is)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static void writeXml(org.w3c.dom.Node n,
java.io.OutputStream os)
throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerExceptionpublic static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
public static org.w3c.dom.Document createDocument()
public static java.lang.String getPrefixRecursive(org.w3c.dom.Element el,
java.lang.String ns)
public static java.lang.String getPrefix(org.w3c.dom.Element el,
java.lang.String ns)
public static java.lang.String createNamespace(org.w3c.dom.Element el,
java.lang.String ns)
public static java.lang.String getNamespace(org.w3c.dom.Element el,
java.lang.String searchPrefix)
el - element to search for namespace definitionssearchPrefix - the prefix we are searching for
|
Apache CXF API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||