Exemplo n.º 1
0
 @Override
 public void visit(ERXML.Visitor visitor) {
   if (visitor.visit(this)) {
     for (ERXML.Item item : _children) {
       item.visit(visitor);
     }
   }
 }
Exemplo n.º 2
0
 /**
  * Returns the XML document, or null if it isn't in a document.
  *
  * @return the XML document, or null if it isn't in a document
  */
 public ERXML.Doc doc() {
   ERXML.Item item = this;
   ERXML.Item parent = null;
   while ((parent = item.parent()) != null) {
     item = parent;
   }
   ERXML.Doc doc = null;
   if (item instanceof ERXML.Doc) {
     doc = (ERXML.Doc) item;
   }
   return doc;
 }
Exemplo n.º 3
0
 @Override
 public void write(PrintWriter writer, int indent) {
   for (ERXML.Item item : _children) {
     item.write(writer, indent);
   }
 }
Exemplo n.º 4
0
 /**
  * Adds a new child to this document.
  *
  * @param child the child to add
  */
 protected void _add(ERXML.Item child) {
   child.setParent(this);
   _children.add(child);
 }