|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ten60.netkernel.util.XMLUtils
A set of low level DOM manipulation methods
Method Summary | |
static void |
appendTextedElement(Node aParent,
String aName,
String aValue)
Creates a named element with text |
static Element |
depthFirstTraversalNextElement(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 String |
escape(String aXML)
escape the given string into a form safe to embed into an XML stream |
static Document |
getDocumentFor(Node aNode)
Returns the document for a node regardless of type - why is DOM so inconsistent? |
static Element |
getFirstChildElement(Node aNode)
finds the first child element |
static XMLUtils |
getInstance()
a different instance is returned for each thread |
static Element |
getNextSiblingElement(Node aNode)
finds the next sibling element |
static String |
getPathFor(Node aNode)
|
static String |
getText(Node aNode)
|
static Element |
inOrderTraversalNext(Node aNode,
Node aRoot)
try down, then across, then ( up-across ) |
static Document |
newDocument()
return a new empty document |
static Document |
parse(InputStream aStream)
parse the document in the given input stream |
static Document |
parse(Reader aReader)
parse the document in the given reader |
static void |
setText(Element aElement,
String aText)
|
String |
toXML(Node aNode,
boolean aIndent,
boolean aOmitDeclaration)
serialise the given node recursively to a string |
void |
toXML(Writer aWriter,
Node aNode,
boolean aIndent,
boolean aOmitDeclaration,
String aEncoding,
int aIndentChars)
write a node out recursively to the given writer |
static void |
write(Writer osw,
String aName,
String aValue)
Write an XML element with text to the writer |
static void |
writeEscaped(Writer osw,
String aName,
String aValue)
Write an escaped XML element with text to the writer |
static void |
writeStack(Writer osw,
StackTraceElement[] aStack,
int aDepth)
Write an stack trace to the writer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static XMLUtils getInstance()
public static void destroyInstances()
public static void destroyInstance()
public static Document newDocument()
public void toXML(Writer aWriter, Node aNode, boolean aIndent, boolean aOmitDeclaration, String aEncoding, int aIndentChars) throws IOException
IOException
public String toXML(Node aNode, boolean aIndent, boolean aOmitDeclaration)
public static String escape(String aXML)
public static Document parse(Reader aReader) throws IOException, SAXException
IOException
SAXException
public static Document parse(InputStream aStream) throws IOException, SAXException
IOException
SAXException
public static String getPathFor(Node aNode)
public static String getText(Node aNode)
public static void setText(Element aElement, String aText)
public static Element getNextSiblingElement(Node aNode)
public static Element getFirstChildElement(Node aNode)
public static Element depthFirstTraversalNextElement(Node aNode)
public static Element inOrderTraversalNext(Node aNode, Node aRoot)
aNode
- next element after this nodeaRoot
- we will not traverse higher than this node (if null ignored)public static Document getDocumentFor(Node aNode)
public static void appendTextedElement(Node aParent, String aName, String aValue)
aParent
- node to add element belowaName
- name of elementaValue
- text value below elementpublic static void write(Writer osw, String aName, String aValue) throws IOException
IOException
public static void writeEscaped(Writer osw, String aName, String aValue) throws IOException
IOException
public static void writeStack(Writer osw, StackTraceElement[] aStack, int aDepth) throws IOException
IOException
|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |