|
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
A set of low level DOM manipulation methods
Field Summary | |
static String |
CANONICAL_BOOLEAN_FALSE
|
static String |
CANONICAL_BOOLEAN_TRUE
|
static String |
CANONICAL_NULL
|
Method Summary | |
static void |
appendTextedElement(Node aParent,
String aName,
String aValue)
Creates a named element with text if it doesn't already exist otherwise it just sets the text below it. |
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 |
Document |
getBooleanDocument(boolean b)
|
static Element |
getChildElementNamed(Node aNode,
String aName)
|
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 |
Document |
getNullDocument()
|
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(InputStream aStream,
String aSystemId,
EntityResolver aEntityResolver)
parse the document in the given input stream with SystemId |
static Document |
parse(Reader aReader)
parse the document in the given reader |
static Document |
parse(Reader aReader,
String aSystemId,
EntityResolver aEntityResolver)
parse the document in the given reader with SystemId |
static Document |
parseImpl(InputSource aSource,
String aSystemId,
EntityResolver aEntityResolver)
|
static String |
pleaseDOMGiveMeTheNameOf(Node aNode)
|
static Node |
safeDeepClone(Node aNode)
|
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)
write a node out recursively to the given writer |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String CANONICAL_NULL
public static final String CANONICAL_BOOLEAN_TRUE
public static final String CANONICAL_BOOLEAN_FALSE
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 void toXML(Writer aWriter, Node aNode, boolean aIndent, boolean aOmitDeclaration) 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(Reader aReader, String aSystemId, EntityResolver aEntityResolver) throws IOException, SAXException
IOException
SAXException
public static Document parse(InputStream aStream) throws IOException, SAXException
IOException
SAXException
public static Document parse(InputStream aStream, String aSystemId, EntityResolver aEntityResolver) throws IOException, SAXException
IOException
SAXException
public static Document parseImpl(InputSource aSource, String aSystemId, EntityResolver aEntityResolver) 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 Document getBooleanDocument(boolean b)
public Document getNullDocument()
public static Element getNextSiblingElement(Node aNode)
public static Element getFirstChildElement(Node aNode)
public static Element getChildElementNamed(Node aNode, String aName)
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 Node safeDeepClone(Node aNode)
public static String pleaseDOMGiveMeTheNameOf(Node aNode)
public 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
|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |