|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jafer.util.xml.DomUtils
public class DomUtils
Field Summary | |
---|---|
private static javax.xml.parsers.DocumentBuilderFactory |
factory
|
Constructor Summary | |
---|---|
DomUtils()
|
Method Summary | |
---|---|
static java.lang.String |
getChildTextValue(org.w3c.dom.Element node,
java.lang.String child)
Get the text node from an element node. |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Gets the DocumentBuilder for parsing xml documents. |
static java.lang.String |
getElementTextByAttr(org.w3c.dom.Element modsroot,
java.lang.String nodename,
java.lang.String attrname,
java.lang.String attrvalue)
Retrieves text of element by attribute value (e.g. |
static java.lang.String |
getNodeAsString(org.w3c.dom.Node node)
|
static java.lang.String |
getSubNodeText(org.w3c.dom.Element modsroot,
java.lang.String nodename,
java.lang.String subnodename)
Retrieves name/subname text value. |
static java.lang.String |
getSubSubNodeText(org.w3c.dom.Element modsroot,
java.lang.String nodename,
java.lang.String subnodename,
java.lang.String subsubnodename)
Retrieves name/subname/subsub text value. |
static java.lang.String |
getTextFields(org.w3c.dom.NodeList list)
Extracts all text values from a list of Element nodes. |
static java.lang.String |
getTextValue(org.w3c.dom.Node node)
Get the text node from an element node. |
static boolean |
hasElementWithAttr(org.w3c.dom.Element modsroot,
java.lang.String nodename,
java.lang.String attrname,
java.lang.String attrvalue)
|
static org.w3c.dom.Document |
newDocument()
Gets an empty Document for manipulating with DOM.. |
static org.w3c.dom.Document |
parse(java.lang.String data)
Parses an xml document. |
static void |
setElementTextByAttr(org.w3c.dom.Element modsroot,
java.lang.String nodename,
java.lang.String attrname,
java.lang.String attrvalue,
java.lang.String newValue)
Sets text of element by attribute value (e.g. |
static void |
setTextValue(org.w3c.dom.Node node,
java.lang.String newValue)
set the text node from an element node. |
static void |
transform(org.w3c.dom.Node sourceNode,
java.io.Writer writer)
Transforms a DOM node to a string and writes it to a writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static javax.xml.parsers.DocumentBuilderFactory factory
Constructor Detail |
---|
public DomUtils()
Method Detail |
---|
public static java.lang.String getElementTextByAttr(org.w3c.dom.Element modsroot, java.lang.String nodename, java.lang.String attrname, java.lang.String attrvalue)
public static boolean hasElementWithAttr(org.w3c.dom.Element modsroot, java.lang.String nodename, java.lang.String attrname, java.lang.String attrvalue)
public static void setElementTextByAttr(org.w3c.dom.Element modsroot, java.lang.String nodename, java.lang.String attrname, java.lang.String attrvalue, java.lang.String newValue)
public static java.lang.String getSubNodeText(org.w3c.dom.Element modsroot, java.lang.String nodename, java.lang.String subnodename)
public static java.lang.String getSubSubNodeText(org.w3c.dom.Element modsroot, java.lang.String nodename, java.lang.String subnodename, java.lang.String subsubnodename)
public static java.lang.String getTextFields(org.w3c.dom.NodeList list)
public static java.lang.String getTextValue(org.w3c.dom.Node node)
public static void setTextValue(org.w3c.dom.Node node, java.lang.String newValue)
public static java.lang.String getChildTextValue(org.w3c.dom.Element node, java.lang.String child)
public static java.lang.String getNodeAsString(org.w3c.dom.Node node) throws DomUtilsException
DomUtilsException
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws DomUtilsException
DomUtilsException
public static org.w3c.dom.Document newDocument() throws DomUtilsException
DomUtilsException
public static org.w3c.dom.Document parse(java.lang.String data) throws DomUtilsException
DomUtilsException
public static void transform(org.w3c.dom.Node sourceNode, java.io.Writer writer) throws DomUtilsException
DomUtilsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |