|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ten60.netkernel.xml.util.XMLUtils
public class XMLUtils
A set of low level DOM manipulation methods
| Field Summary | |
|---|---|
static java.lang.String |
CANONICAL_BOOLEAN_FALSE
|
static java.lang.String |
CANONICAL_BOOLEAN_TRUE
|
static java.lang.String |
CANONICAL_NULL
|
| Method Summary | |
|---|---|
static void |
appendTextedElement(org.w3c.dom.Node aParent,
java.lang.String aName,
java.lang.String aValue)
Creates a named element with text if it doesn't already exist otherwise it just sets the text below it. |
static org.w3c.dom.Element |
depthFirstTraversalNextElement(org.w3c.dom.Node aNode)
try down, then across, not ( up-across ) |
static void |
destroyInstance()
removes singleton associated with the current thread |
static void |
destroyInstances()
clear out all singletons |
static java.lang.String |
escape(java.lang.String aXML)
escape the given string into a form safe to embed into an XML stream |
org.w3c.dom.Document |
getBooleanDocument(boolean b)
|
static org.w3c.dom.Element |
getChildElementNamed(org.w3c.dom.Node aNode,
java.lang.String aName)
|
static org.w3c.dom.Document |
getDocumentFor(org.w3c.dom.Node aNode)
Returns the document for a node regardless of type - why is DOM so inconsistent? |
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Node aNode)
finds the first child element |
static XMLUtils |
getInstance()
a different instance is returned for each thread |
static org.w3c.dom.Element |
getNextSiblingElement(org.w3c.dom.Node aNode)
finds the next sibling element |
org.w3c.dom.Document |
getNullDocument()
|
static java.lang.String |
getPathFor(org.w3c.dom.Node aNode)
|
static java.lang.String |
getText(org.w3c.dom.Node aNode)
|
static org.w3c.dom.Element |
inOrderTraversalNext(org.w3c.dom.Node aNode,
org.w3c.dom.Node aRoot)
try down, then across, then ( up-across ) |
static org.w3c.dom.Document |
newDocument()
return a new empty document |
static org.w3c.dom.Document |
parse(java.io.InputStream aStream)
parse the document in the given input stream |
static org.w3c.dom.Document |
parse(java.io.Reader aReader)
parse the document in the given reader |
static java.lang.String |
pleaseDOMGiveMeTheNameOf(org.w3c.dom.Node aNode)
|
static org.w3c.dom.Node |
safeDeepClone(org.w3c.dom.Node aNode)
|
static void |
setText(org.w3c.dom.Element aElement,
java.lang.String aText)
|
java.lang.String |
toXML(org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration)
serialise the given node recursively to a string |
void |
toXML(java.io.Writer aWriter,
org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration)
write a node out recursively to the given writer |
void |
toXML(java.io.Writer aWriter,
org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration,
java.lang.String aEncoding,
int aIndentChars)
write a node out recursively to the given writer |
static void |
write(java.io.Writer osw,
java.lang.String aName,
java.lang.String aValue)
Write an XML element with text to the writer |
static void |
writeEscaped(java.io.Writer osw,
java.lang.String aName,
java.lang.String aValue)
Write an escaped XML element with text to the writer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CANONICAL_NULL
public static final java.lang.String CANONICAL_BOOLEAN_TRUE
public static final java.lang.String CANONICAL_BOOLEAN_FALSE
| Method Detail |
|---|
public static XMLUtils getInstance()
public static void destroyInstances()
public static void destroyInstance()
public static org.w3c.dom.Document newDocument()
public void toXML(java.io.Writer aWriter,
org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration,
java.lang.String aEncoding,
int aIndentChars)
throws java.io.IOException
java.io.IOException
public void toXML(java.io.Writer aWriter,
org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration)
throws java.io.IOException
java.io.IOException
public java.lang.String toXML(org.w3c.dom.Node aNode,
boolean aIndent,
boolean aOmitDeclaration)
public static java.lang.String escape(java.lang.String aXML)
public static org.w3c.dom.Document parse(java.io.Reader aReader)
throws java.io.IOException,
org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public static org.w3c.dom.Document parse(java.io.InputStream aStream)
throws java.io.IOException,
org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXExceptionpublic static java.lang.String getPathFor(org.w3c.dom.Node aNode)
public static java.lang.String getText(org.w3c.dom.Node aNode)
public static void setText(org.w3c.dom.Element aElement,
java.lang.String aText)
public org.w3c.dom.Document getBooleanDocument(boolean b)
public org.w3c.dom.Document getNullDocument()
public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node aNode)
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node aNode)
public static org.w3c.dom.Element getChildElementNamed(org.w3c.dom.Node aNode,
java.lang.String aName)
public static org.w3c.dom.Element depthFirstTraversalNextElement(org.w3c.dom.Node aNode)
public static org.w3c.dom.Element inOrderTraversalNext(org.w3c.dom.Node aNode,
org.w3c.dom.Node aRoot)
aNode - next element after this nodeaRoot - we will not traverse higher than this node (if null ignored)public static org.w3c.dom.Document getDocumentFor(org.w3c.dom.Node aNode)
public static void appendTextedElement(org.w3c.dom.Node aParent,
java.lang.String aName,
java.lang.String aValue)
aParent - node to add element belowaName - name of elementaValue - text value below elementpublic static org.w3c.dom.Node safeDeepClone(org.w3c.dom.Node aNode)
public static java.lang.String pleaseDOMGiveMeTheNameOf(org.w3c.dom.Node aNode)
public static void write(java.io.Writer osw,
java.lang.String aName,
java.lang.String aValue)
throws java.io.IOException
java.io.IOException
public static void writeEscaped(java.io.Writer osw,
java.lang.String aName,
java.lang.String aValue)
throws java.io.IOException
java.io.IOException
|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||