|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxtom.parser.XMLTree
Description: The XMLTree is the model representation of
the XML document. It provides easy to use access to elements and their
children, and attributes.
Field Summary | |
private boolean |
caseSensitive
Sets the sensitivity of element names, default true |
private Element |
rootElement
Root element of the XML document |
private java.util.Stack |
searchTerms
|
Constructor Summary | |
private |
XMLTree()
|
|
XMLTree(Element root)
Creates a new XMLTree |
Method Summary | |
private void |
generateXMLAttributes(java.lang.StringBuffer xml,
Element el)
Generates Attribute XML markup for this element. |
private void |
generateXMLChildren(java.lang.StringBuffer xml,
Element el)
Generates XML markup for this element. |
Element |
getRootElement()
|
boolean |
isCaseSensitive()
|
private void |
printAttributes(java.lang.StringBuffer xml,
Element el)
Prints attributes to the XMLBuffer for display. |
private void |
printChildren(java.lang.StringBuffer xml,
Element el,
int level)
Prints children to the XML Buffer for display. |
private java.lang.String |
printTabs(int howMany)
Helper method to print tabs. |
void |
printTree(java.io.OutputStream o)
Prints an String representation of the tree to a specified outputstream. |
void |
setCaseSensitive(boolean caseSensitive)
Sets the whole tree to be case sensitive or not. |
java.lang.String |
toString()
The toString method returns toXML() generated xml |
java.lang.String |
toXML()
Generates an XML document from an existing tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.Stack searchTerms
private Element rootElement
private boolean caseSensitive
Constructor Detail |
private XMLTree()
public XMLTree(Element root)
root
- The root element.
MissingRootElementException
- if the root element is null.Method Detail |
public Element getRootElement()
public void printTree(java.io.OutputStream o)
o
- OutputStream to use when printing.
java.lang.IllegalArgumentException
- if the outputstream is null.private void printAttributes(java.lang.StringBuffer xml, Element el)
xml
- el
- Does not do anything if xml or el is null.private void printChildren(java.lang.StringBuffer xml, Element el, int level)
xml
- el
- Does not do anything if xml or el is null.private java.lang.String printTabs(int howMany)
howMany
-
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- The caseSensitive to set.public java.lang.String toXML()
private void generateXMLChildren(java.lang.StringBuffer xml, Element el)
xml
- el
- private void generateXMLAttributes(java.lang.StringBuffer xml, Element el)
xml
- el
- public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |