XMLNode is the in memory representation of an XML node in the XMLStorage library. More...


Classes | |
| class | AttributeMap |
| AttributeMap is a sorted map of attributes, used to prevent type cast warning in assign(). More... | |
| class | Children |
| Children contains the list of immediate child nodes. More... | |
Public Member Functions | |
| XMLNode (final String name) | |
| XMLNode (final String name, final String leading) | |
| XMLNode (final XMLNode other) | |
| String | getName () |
| String | toString () |
| void | clear () |
| void | assign (final XMLNode other) |
| void | addChild (XMLNode child) |
| add a new child node | |
| String | get (final String attrName) |
| read only access to an attribute | |
| String | get (final String attrName, final String def) |
| read only access to an attribute with default value | |
| void | put (final String attrName, final String value) |
| write access to an attribute | |
| String | getSubattrib (final String nodeName, final String attrName) |
| convenient value access in children node | |
| String | getSubattrib (final String nodeName, final String attrName, int n) |
| void | putSubattrib (final String nodeName, final String attrName, final String value) |
| convenient storage of distinct values in children node | |
| void | putSubattrib (final String nodeName, final String attrName, final String value, int n) |
| Children | getChildren () |
| String | getContent () |
| void | setContent (final String s) |
| void | setContent (final String s, boolean cdata) |
| void | write (Writer out) throws Exception |
| pretty print node to stream without preserving original white space | |
| void | write (Writer out, int mode) throws Exception |
| void | write (Writer out, int mode, int indent) throws IOException |
| write node with children tree | |
| XMLNode | find (final String nodeName) |
| Find a children node by name. | |
| XMLNode | find (final String nodeName, int n) |
| Find the n'th children node with tag nodeName. | |
| XMLNode | find (final String nodeName, final String attrName, final String attrValue) |
| Search matching child node identified by key name and an attribute value. | |
| XMLNode | find (final String nodeName, final String attrName, final String attrValue, int n) |
| Search matching child node identified by key name and an attribute value. | |
| XMLInt | getInt (final String attrName) |
| XMLInt | getInt (final String attrName, int def) |
| XMLNumber | getNumber (final String attrName) |
| XMLNumber | getNumber (final String attrName, BigDecimal def) |
| XMLBool | getBool (final String attrName) |
| XMLBool | getBool (final String attrName, boolean def) |
| XMLString | getString (final String attrName) |
| XMLString | getString (final String attrName, final String def) |
Static Public Attributes | |
| static final int | FORMAT_SMART = 0 |
| static final int | FORMAT_ORIGINAL = 1 |
| preserve original white space and comments if present; pretty print otherwise | |
| static final int | FORMAT_PRETTY = 2 |
| write XML stream preserving original white space and comments | |
| static final String | XML_INDENT_SPACE = " " |
Protected Member Functions | |
| XMLNode | getFirstChild () |
| void | writeWorker (Writer out, int indent) throws IOException |
| Write node with children tree using original white space. | |
| void | prettyWriteWorker (Writer out, int indent) throws IOException |
| void | smartWriteWorker (Writer out, int indent) throws IOException |
Protected Attributes | |
| String | _name |
| Children | _children = new Children() |
| AttributeMap | _attributes = new AttributeMap() |
| String | _leading = "" |
| String | _content = "" |
| String | _endLeading = "" |
| String | _trailing = "" |
Package Functions | |
| XMLNode | findRelative (XPath xpath) |
| XPath find function. | |
| AbstractXMLNode | createRelative (XPath xpath) |
| relative XPath create function | |
XMLNode is the in memory representation of an XML node in the XMLStorage library.
Definition at line 53 of file XMLNode.java.
| de.mfuchs.xmlstorage.XMLNode.XMLNode | ( | final String | name ) |
Definition at line 55 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._name.
Referenced by de.mfuchs.xmlstorage.XMLNode.Children.assign(), de.mfuchs.xmlstorage.XMLNode.createRelative(), and de.mfuchs.xmlstorage.XMLNode.putSubattrib().
{
_name = name;
}
| de.mfuchs.xmlstorage.XMLNode.XMLNode | ( | final String | name, |
| final String | leading | ||
| ) |
Definition at line 60 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._leading, and de.mfuchs.xmlstorage.XMLNode._name.
| de.mfuchs.xmlstorage.XMLNode.XMLNode | ( | final XMLNode | other ) |
Definition at line 66 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.assign().
{
assign(other);
}

| void de.mfuchs.xmlstorage.XMLNode.addChild | ( | XMLNode | child ) |
add a new child node
Definition at line 152 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
Referenced by de.mfuchs.xmlstorage.XMLPos.addDown(), de.mfuchs.xmlstorage.XMLNode.createRelative(), and de.mfuchs.xmlstorage.XMLNode.putSubattrib().
{
_children.addLast(child);
}
| void de.mfuchs.xmlstorage.XMLNode.assign | ( | final XMLNode | other ) |
Definition at line 139 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes, de.mfuchs.xmlstorage.XMLNode._children, de.mfuchs.xmlstorage.XMLNode._content, de.mfuchs.xmlstorage.XMLNode._endLeading, de.mfuchs.xmlstorage.XMLNode._leading, de.mfuchs.xmlstorage.XMLNode._trailing, and de.mfuchs.xmlstorage.XMLNode.Children.assign().
Referenced by de.mfuchs.xmlstorage.XMLNode.XMLNode().
{
_children.assign(other._children);
_attributes = (AttributeMap) other._attributes.clone();
_leading = other._leading;
_content = other._content;
_endLeading = other._endLeading;
_trailing = other._trailing;
}

| void de.mfuchs.xmlstorage.XMLNode.clear | ( | ) |
Definition at line 126 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes, de.mfuchs.xmlstorage.XMLNode._children, de.mfuchs.xmlstorage.XMLNode._content, de.mfuchs.xmlstorage.XMLNode._endLeading, de.mfuchs.xmlstorage.XMLNode._leading, de.mfuchs.xmlstorage.XMLNode._name, de.mfuchs.xmlstorage.XMLNode._trailing, and de.mfuchs.xmlstorage.XMLNode.Children.clear().
Referenced by de.mfuchs.xmlstorage.XMLNode.Children.clear().
{
_leading = "";
_content = "";
_endLeading = "";
_trailing = "";
_attributes.clear();
_children.clear();
_name = "";
}

| AbstractXMLNode de.mfuchs.xmlstorage.XMLNode.createRelative | ( | XPath | xpath ) | [package] |
relative XPath create function
Definition at line 372 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.addChild(), de.mfuchs.xmlstorage.XMLNode.find(), de.mfuchs.xmlstorage.XMLNode.put(), and de.mfuchs.xmlstorage.XMLNode.XMLNode().
{
XMLNode node = this;
for(XPathElement elem : xpath) {
XMLNode child = elem.find(node);
if (child == null) {
child = new XMLNode(elem._childName);
node.addChild(child);
for(Map.Entry<String, String> it : elem._mAttrAndAttr.entrySet())
put(it.getKey(), it.getValue());
}
node = child;
}
return node;
}

| XMLNode de.mfuchs.xmlstorage.XMLNode.find | ( | final String | nodeName ) |
Find a children node by name.
| nodeName |
Definition at line 297 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
Referenced by de.mfuchs.xmlstorage.XMLNode.createRelative(), de.mfuchs.xmlstorage.XMLNode.findRelative(), de.mfuchs.xmlstorage.XMLNode.getSubattrib(), de.mfuchs.xmlstorage.XMLPos.goDown(), de.mfuchs.xmlstorage.XMLNode.putSubattrib(), and de.mfuchs.xmlstorage.XMLPos.smartCreate().
| XMLNode de.mfuchs.xmlstorage.XMLNode.find | ( | final String | nodeName, |
| int | n | ||
| ) |
Find the n'th children node with tag nodeName.
| nodeName | |
| n |
Definition at line 312 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
| XMLNode de.mfuchs.xmlstorage.XMLNode.find | ( | final String | nodeName, |
| final String | attrName, | ||
| final String | attrValue | ||
| ) |
Search matching child node identified by key name and an attribute value.
| nodeName | |
| attrName | |
| attrValue |
Definition at line 329 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
| XMLNode de.mfuchs.xmlstorage.XMLNode.find | ( | final String | nodeName, |
| final String | attrName, | ||
| final String | attrValue, | ||
| int | n | ||
| ) |
Search matching child node identified by key name and an attribute value.
| nodeName | |
| attrName | |
| attrValue | |
| n |
Definition at line 346 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
XPath find function.
Definition at line 357 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.find().
Referenced by de.mfuchs.xmlstorage.XMLPos.go().
{
XMLNode node = this;
for(XPathElement xelem : xpath) {
node = xelem.find(node);
if (node == null)
break;
}
return node;
}

| String de.mfuchs.xmlstorage.XMLNode.get | ( | final String | attrName ) | [virtual] |
read only access to an attribute
Implements de.mfuchs.xmlstorage.AbstractXMLNode.
Definition at line 158 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes.
Referenced by de.mfuchs.xmlstorage.XMLNumberRef.bigDecimalValue(), de.mfuchs.xmlstorage.XMLBoolRef.boolValue(), de.mfuchs.xmlstorage.XMLPos.get(), de.mfuchs.xmlstorage.XMLIntRef.intValue(), de.mfuchs.xmlstorage.XMLStringRef.toString(), de.mfuchs.xmlstorage.XMLBoolRef.XMLBoolRef(), de.mfuchs.xmlstorage.XMLIntRef.XMLIntRef(), de.mfuchs.xmlstorage.XMLNumberRef.XMLNumberRef(), and de.mfuchs.xmlstorage.XMLStringRef.XMLStringRef().
{
String found = _attributes.get(attrName);
if (found != null)
return found;
else
return "";
}
| String de.mfuchs.xmlstorage.XMLNode.get | ( | final String | attrName, |
| final String | def | ||
| ) | [virtual] |
read only access to an attribute with default value
Implements de.mfuchs.xmlstorage.AbstractXMLNode.
Definition at line 169 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes.
{
String found = _attributes.get(attrName);
if (found != null)
return found;
else
return def;
}
| XMLBool de.mfuchs.xmlstorage.AbstractXMLNode.getBool | ( | final String | attrName ) | [inherited] |
Definition at line 42 of file AbstractXMLNode.java.
{
return new XMLBool(this, attrName);
}
| XMLBool de.mfuchs.xmlstorage.AbstractXMLNode.getBool | ( | final String | attrName, |
| boolean | def | ||
| ) | [inherited] |
Definition at line 46 of file AbstractXMLNode.java.
{
return new XMLBool(this, attrName, def);
}
| Children de.mfuchs.xmlstorage.XMLNode.getChildren | ( | ) |
Definition at line 231 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
Referenced by de.mfuchs.xmlstorage.XMLChildrenFilter.XMLChildrenFilter().
{
return _children;
}
| String de.mfuchs.xmlstorage.XMLNode.getContent | ( | ) | [virtual] |
Implements de.mfuchs.xmlstorage.AbstractXMLNode.
Definition at line 236 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._content, and de.mfuchs.xmlstorage.XMLHelper.decodeXMLString().
Referenced by de.mfuchs.xmlstorage.XMLPos.getContent().
{
return XMLHelper.decodeXMLString(_content);
}

| XMLNode de.mfuchs.xmlstorage.XMLNode.getFirstChild | ( | ) | [protected] |
Definition at line 284 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._children.
Referenced by de.mfuchs.xmlstorage.XMLPos.goDown().
| XMLInt de.mfuchs.xmlstorage.AbstractXMLNode.getInt | ( | final String | attrName, |
| int | def | ||
| ) | [inherited] |
Definition at line 28 of file AbstractXMLNode.java.
{
return new XMLInt(this, attrName, def);
}
| XMLInt de.mfuchs.xmlstorage.AbstractXMLNode.getInt | ( | final String | attrName ) | [inherited] |
Definition at line 24 of file AbstractXMLNode.java.
{
return new XMLInt(this, attrName);
}
| String de.mfuchs.xmlstorage.XMLNode.getName | ( | ) | [virtual] |
Implements de.mfuchs.xmlstorage.AbstractXMLNode.
Definition at line 73 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._name.
{
return _name;
}
| XMLNumber de.mfuchs.xmlstorage.AbstractXMLNode.getNumber | ( | final String | attrName ) | [inherited] |
Definition at line 33 of file AbstractXMLNode.java.
{
return new XMLNumber(this, attrName);
}
| XMLNumber de.mfuchs.xmlstorage.AbstractXMLNode.getNumber | ( | final String | attrName, |
| BigDecimal | def | ||
| ) | [inherited] |
Definition at line 37 of file AbstractXMLNode.java.
{
return new XMLNumber(this, attrName, def);
}
| XMLString de.mfuchs.xmlstorage.AbstractXMLNode.getString | ( | final String | attrName ) | [inherited] |
Definition at line 51 of file AbstractXMLNode.java.
{
return new XMLString(this, attrName);
}
| XMLString de.mfuchs.xmlstorage.AbstractXMLNode.getString | ( | final String | attrName, |
| final String | def | ||
| ) | [inherited] |
Definition at line 55 of file AbstractXMLNode.java.
{
return new XMLString(this, attrName, def);
}
| String de.mfuchs.xmlstorage.XMLNode.getSubattrib | ( | final String | nodeName, |
| final String | attrName | ||
| ) |
convenient value access in children node
Definition at line 186 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.find(), and de.mfuchs.xmlstorage.AbstractXMLNode.get().
{
final AbstractXMLNode node = find(nodeName);
if (node != null)
return node.get(attrName);
else
return "";
}

| String de.mfuchs.xmlstorage.XMLNode.getSubattrib | ( | final String | nodeName, |
| final String | attrName, | ||
| int | n | ||
| ) |
Definition at line 196 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.find(), and de.mfuchs.xmlstorage.AbstractXMLNode.get().
{
final AbstractXMLNode node = find(nodeName, n);
if (node != null)
return node.get(attrName);
else
return "";
}

| void de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker | ( | Writer | out, |
| int | indent | ||
| ) | throws IOException [protected] |
Definition at line 438 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes, de.mfuchs.xmlstorage.XMLNode._children, de.mfuchs.xmlstorage.XMLNode._content, de.mfuchs.xmlstorage.XMLNode._name, de.mfuchs.xmlstorage.XMLHelper.encodeXMLString(), and de.mfuchs.xmlstorage.XMLNode.XML_INDENT_SPACE.
Referenced by de.mfuchs.xmlstorage.XMLNode.write().
{
for(int i=indent; i-->0; )
out.write(XML_INDENT_SPACE);
out.write('<');
out.write(XMLHelper.encodeXMLString(_name));
for(Map.Entry<String,String> it : _attributes.entrySet()) {
String attrValue = it.getValue();
if (attrValue != null) {
out.write(' ');
out.write(XMLHelper.encodeXMLString(it.getKey()));
out.write("=\"");
out.write(XMLHelper.encodeXMLString(attrValue));
out.write("\"");
}
}
if (!_children.isEmpty() || _content.length()>0) {
out.write(">\n");
for(XMLNode child : _children)
child.prettyWriteWorker(out, indent+1);
for(int i=indent; i-->0; )
out.write(XML_INDENT_SPACE);
out.write("</");
out.write(XMLHelper.encodeXMLString(_name));
out.write(">\n");
} else
out.write("/>\n");
}

| void de.mfuchs.xmlstorage.XMLNode.put | ( | final String | attrName, |
| final String | value | ||
| ) |
write access to an attribute
Definition at line 180 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes.
Referenced by de.mfuchs.xmlstorage.XMLStringRef.assign(), de.mfuchs.xmlstorage.XMLNumberRef.assign(), de.mfuchs.xmlstorage.XMLIntRef.assign(), de.mfuchs.xmlstorage.XMLBoolRef.assign(), de.mfuchs.xmlstorage.XMLNode.createRelative(), de.mfuchs.xmlstorage.stream.XMLStreamWriter.put(), de.mfuchs.xmlstorage.XMLPos.put(), de.mfuchs.xmlstorage.XMLNode.putSubattrib(), and de.mfuchs.xmlstorage.XMLPos.smartCreate().
{
_attributes.put(attrName, value);
}
| void de.mfuchs.xmlstorage.XMLNode.putSubattrib | ( | final String | nodeName, |
| final String | attrName, | ||
| final String | value | ||
| ) |
convenient storage of distinct values in children node
Definition at line 207 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.addChild(), de.mfuchs.xmlstorage.XMLNode.find(), de.mfuchs.xmlstorage.XMLNode.put(), and de.mfuchs.xmlstorage.XMLNode.XMLNode().
Referenced by de.mfuchs.xmlstorage.XMLPos.putSubattrib().
{
XMLNode node = find(nodeName);
if (node == null) {
node = new XMLNode(nodeName);
addChild(node);
}
node.put(attrName, value);
}

| void de.mfuchs.xmlstorage.XMLNode.putSubattrib | ( | final String | nodeName, |
| final String | attrName, | ||
| final String | value, | ||
| int | n | ||
| ) |
Definition at line 219 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.addChild(), de.mfuchs.xmlstorage.XMLNode.find(), de.mfuchs.xmlstorage.XMLNode.put(), and de.mfuchs.xmlstorage.XMLNode.XMLNode().
{
XMLNode node = find(nodeName, n);
if (node == null) {
node = new XMLNode(nodeName);
addChild(node);
}
node.put(attrName, value);
}

| void de.mfuchs.xmlstorage.XMLNode.setContent | ( | final String | s ) |
Definition at line 241 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLPos.setContent().
{
setContent(s, false);
}
| void de.mfuchs.xmlstorage.XMLNode.setContent | ( | final String | s, |
| boolean | cdata | ||
| ) |
Definition at line 246 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._content, and de.mfuchs.xmlstorage.XMLHelper.encodeXMLString().
{
_content = XMLHelper.encodeXMLString(s, cdata);
}

| void de.mfuchs.xmlstorage.XMLNode.smartWriteWorker | ( | Writer | out, |
| int | indent | ||
| ) | throws IOException [protected] |
Definition at line 474 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes, de.mfuchs.xmlstorage.XMLNode._children, de.mfuchs.xmlstorage.XMLNode._content, de.mfuchs.xmlstorage.XMLNode._endLeading, de.mfuchs.xmlstorage.XMLNode._leading, de.mfuchs.xmlstorage.XMLNode._name, de.mfuchs.xmlstorage.XMLNode._trailing, de.mfuchs.xmlstorage.XMLHelper.encodeXMLString(), and de.mfuchs.xmlstorage.XMLNode.XML_INDENT_SPACE.
Referenced by de.mfuchs.xmlstorage.XMLNode.write().
{
if (_leading.length() == 0)
for(int i=indent; i-->0; )
out.write(XML_INDENT_SPACE);
else
out.write(_leading);
out.write('<');
out.write(XMLHelper.encodeXMLString(_name));
for(Map.Entry<String,String> it : _attributes.entrySet()) {
String attrValue = it.getValue();
if (attrValue != null) {
out.write(' ');
out.write(XMLHelper.encodeXMLString(it.getKey()));
out.write("=\"");
out.write(XMLHelper.encodeXMLString(attrValue));
out.write("\"");
}
}
if (_children.isEmpty() && _content.length()==0)
out.write("/>");
else {
out.write('>');
if (_content.length() == 0)
out.write('\n');
else
out.write(_content);
Iterator<XMLNode> it = _children.iterator();
if (it.hasNext()) {
while(it.hasNext())
it.next().smartWriteWorker(out, indent+1);
if (_endLeading.length() == 0)
for(int i=indent; i-->0; )
out.write(XML_INDENT_SPACE);
else
out.write(_endLeading);
} else
out.write(_endLeading);
out.write("</");
out.write(XMLHelper.encodeXMLString(_name));
out.write('>');
}
if (_trailing.length() == 0)
out.write('\n');
else
out.write(_trailing);
}

| String de.mfuchs.xmlstorage.XMLNode.toString | ( | ) | [virtual] |
Implements de.mfuchs.xmlstorage.AbstractXMLNode.
Definition at line 78 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._name.
Referenced by de.mfuchs.xmlstorage.XMLPos.toString().
{
return _name;
}
| void de.mfuchs.xmlstorage.XMLNode.write | ( | Writer | out ) | throws Exception |
pretty print node to stream without preserving original white space
Reimplemented in de.mfuchs.xmlstorage.XMLDoc.
Definition at line 257 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.FORMAT_SMART.
Referenced by de.mfuchs.xmlstorage.XMLNode.write().
{
write(out, FORMAT_SMART, 0);
}
| void de.mfuchs.xmlstorage.XMLNode.write | ( | Writer | out, |
| int | mode | ||
| ) | throws Exception |
Reimplemented in de.mfuchs.xmlstorage.XMLDoc.
Definition at line 262 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.write().
{
write(out, mode, 0);
}

| void de.mfuchs.xmlstorage.XMLNode.write | ( | Writer | out, |
| int | mode, | ||
| int | indent | ||
| ) | throws IOException |
write node with children tree
Definition at line 268 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode.FORMAT_ORIGINAL, de.mfuchs.xmlstorage.XMLNode.FORMAT_PRETTY, de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
{
switch(mode) {
case FORMAT_PRETTY:
prettyWriteWorker(out, indent);
break;
case FORMAT_ORIGINAL:
writeWorker(out, indent);
break;
default: // FORMAT_SMART
smartWriteWorker(out, indent);
}
}

| void de.mfuchs.xmlstorage.XMLNode.writeWorker | ( | Writer | out, |
| int | indent | ||
| ) | throws IOException [protected] |
Write node with children tree using original white space.
| out | |
| indent |
| IOException |
Definition at line 400 of file XMLNode.java.
References de.mfuchs.xmlstorage.XMLNode._attributes, de.mfuchs.xmlstorage.XMLNode._children, de.mfuchs.xmlstorage.XMLNode._content, de.mfuchs.xmlstorage.XMLNode._endLeading, de.mfuchs.xmlstorage.XMLNode._leading, de.mfuchs.xmlstorage.XMLNode._name, de.mfuchs.xmlstorage.XMLNode._trailing, and de.mfuchs.xmlstorage.XMLHelper.encodeXMLString().
Referenced by de.mfuchs.xmlstorage.XMLNode.write().
{
out.write(_leading);
out.write('<');
out.write(XMLHelper.encodeXMLString(_name));
for(Map.Entry<String,String> it : _attributes.entrySet()) {
String attrValue = it.getValue();
if (attrValue != null) {
out.write(' ');
out.write(XMLHelper.encodeXMLString(it.getKey()));
out.write("=\"");
out.write(XMLHelper.encodeXMLString(attrValue));
out.write("\"");
}
}
if (!_children.isEmpty() || _content.length()>0) {
out.write('>');
out.write(_content);
for(XMLNode child: _children)
child.writeWorker(out, indent+1);
out.write(_endLeading);
out.write("</");
out.write(XMLHelper.encodeXMLString(_name));
out.write('>');
} else
out.write("/>");
out.write(_trailing);
}

AttributeMap de.mfuchs.xmlstorage.XMLNode._attributes = new AttributeMap() [protected] |
Definition at line 119 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLNode.get(), de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLNode.put(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLDocReader.startElement(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
Children de.mfuchs.xmlstorage.XMLNode._children = new Children() [protected] |
Definition at line 118 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.addChild(), de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLDocReader.endElement(), de.mfuchs.xmlstorage.XPathElement.find(), de.mfuchs.xmlstorage.XMLNode.find(), de.mfuchs.xmlstorage.XMLNode.getChildren(), de.mfuchs.xmlstorage.XMLNode.getFirstChild(), de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLDocReader.read(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLDocReader.startElement(), de.mfuchs.xmlstorage.XMLDoc.write(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
String de.mfuchs.xmlstorage.XMLNode._content = "" [protected] |
Definition at line 122 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLDocReader.endElement(), de.mfuchs.xmlstorage.XMLNode.getContent(), de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLNode.setContent(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLDocReader.startElement(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
String de.mfuchs.xmlstorage.XMLNode._endLeading = "" [protected] |
Definition at line 123 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLDocReader.endElement(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
String de.mfuchs.xmlstorage.XMLNode._leading = "" [protected] |
Definition at line 121 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLNode.writeWorker(), and de.mfuchs.xmlstorage.XMLNode.XMLNode().
String de.mfuchs.xmlstorage.XMLNode._name [protected] |
Definition at line 71 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLNode.getName(), de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLNode.toString(), de.mfuchs.xmlstorage.XMLNode.writeWorker(), and de.mfuchs.xmlstorage.XMLNode.XMLNode().
String de.mfuchs.xmlstorage.XMLNode._trailing = "" [protected] |
Definition at line 124 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.assign(), de.mfuchs.xmlstorage.XMLNode.clear(), de.mfuchs.xmlstorage.XMLDocReader.read(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.XMLDocReader.startElement(), and de.mfuchs.xmlstorage.XMLNode.writeWorker().
final int de.mfuchs.xmlstorage.XMLNode.FORMAT_ORIGINAL = 1 [static] |
preserve original white space and comments if present; pretty print otherwise
Definition at line 254 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.write().
final int de.mfuchs.xmlstorage.XMLNode.FORMAT_PRETTY = 2 [static] |
write XML stream preserving original white space and comments
Definition at line 255 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.write(), and de.mfuchs.xmlstorage.XMLDoc.writeFormating().
final int de.mfuchs.xmlstorage.XMLNode.FORMAT_SMART = 0 [static] |
Definition at line 253 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.write(), de.mfuchs.xmlstorage.XMLDoc.write(), and de.mfuchs.xmlstorage.XMLDoc.writeFile().
final String de.mfuchs.xmlstorage.XMLNode.XML_INDENT_SPACE = " " [static] |
Definition at line 436 of file XMLNode.java.
Referenced by de.mfuchs.xmlstorage.XMLNode.prettyWriteWorker(), de.mfuchs.xmlstorage.XMLNode.smartWriteWorker(), de.mfuchs.xmlstorage.stream.XMLStreamWriter.writePost(), and de.mfuchs.xmlstorage.stream.XMLStreamWriter.writePre().
1.7.2