|
NextApp Echo3 v3.0.b4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.app.util.DomUtil
public class DomUtil
A utility class which provides methods for working with a W3C DOM.
Field Summary | |
---|---|
static java.util.Properties |
OUTPUT_PROPERTIES_INDENT
|
Method Summary | |
---|---|
static org.w3c.dom.Document |
createDocument(java.lang.String qualifiedName,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String namespaceUri)
Creates a new document. |
static boolean |
getBooleanAttribute(org.w3c.dom.Element element,
java.lang.String attributeName)
Determines whether a specific boolean flag is set on an element. |
static org.w3c.dom.Element |
getChildElementByTagName(org.w3c.dom.Element parentElement,
java.lang.String name)
Retrieves the first immediate child element of the specified element whose name matches the provided name parameter. |
static int |
getChildElementCountByTagName(org.w3c.dom.Element parentElement,
java.lang.String name)
Counts the number of immediate child elements of the specified element whose names match the provided name parameter. |
static org.w3c.dom.Element[] |
getChildElementsByTagName(org.w3c.dom.Element parentElement,
java.lang.String name)
Retrieves all immediate child elements of the specified element whose names match the provided name parameter. |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Retrieves a thread-specific DocumentBuilder . |
static java.lang.String |
getElementText(org.w3c.dom.Element element)
Returns the text content of a DOM Element . |
static javax.xml.transform.TransformerFactory |
getTransformerFactory()
Retrieves a thread-specific TransformerFactory . |
static void |
save(org.w3c.dom.Document document,
java.io.OutputStream out,
java.util.Properties outputProperties)
Writes the Document to the specified OutputStream . |
static void |
save(org.w3c.dom.Document document,
java.io.PrintWriter w,
java.util.Properties outputProperties)
Writes the Document to the specified PrintWriter . |
static void |
setElementText(org.w3c.dom.Element element,
java.lang.String value)
Sets the text content of a DOM Element . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Properties OUTPUT_PROPERTIES_INDENT
Method Detail |
---|
public static org.w3c.dom.Document createDocument(java.lang.String qualifiedName, java.lang.String publicId, java.lang.String systemId, java.lang.String namespaceUri)
qualifiedName
- the qualified name of the document type to be
createdpublicId
- the external subset public identifiersystemId
- the external subset system identifiernamespaceUri
- the namespace URI of the document element to createpublic static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
DocumentBuilder
.
DocumentBuilder
serving the current thread.public static javax.xml.transform.TransformerFactory getTransformerFactory()
TransformerFactory
.
TransformerFactory
serving the current thread.public static boolean getBooleanAttribute(org.w3c.dom.Element element, java.lang.String attributeName)
element
- The element to analyze.attributeName
- The name of the boolean 'flag' attribute.
public static org.w3c.dom.Element getChildElementByTagName(org.w3c.dom.Element parentElement, java.lang.String name)
name
parameter.
parentElement
- The element to search.name
- The name of the child element.
public static org.w3c.dom.Element[] getChildElementsByTagName(org.w3c.dom.Element parentElement, java.lang.String name)
name
parameter.
parentElement
- The element to search.name
- The name of the child element.
public static int getChildElementCountByTagName(org.w3c.dom.Element parentElement, java.lang.String name)
name
parameter.
parentElement
- The element to analyze.name
- The name of the child element.
public static java.lang.String getElementText(org.w3c.dom.Element element)
Element
.
element
- The Element
to analyze.public static void save(org.w3c.dom.Document document, java.io.OutputStream out, java.util.Properties outputProperties) throws org.xml.sax.SAXException
Document
to the specified OutputStream
.
document
- the Document
out
- the OutputStream
outputProperties
- output properties passed to XML transformer
org.xml.sax.SAXException
public static void save(org.w3c.dom.Document document, java.io.PrintWriter w, java.util.Properties outputProperties) throws org.xml.sax.SAXException
Document
to the specified PrintWriter
.
document
- the Document
w
- the PrintWriter
outputProperties
- output properties passed to XML transformer
org.xml.sax.SAXException
public static void setElementText(org.w3c.dom.Element element, java.lang.String value)
Element
.
element
- The Element
to modify.value
- The new text value.
|
NextApp Echo3 v3.0.b4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |