Ejemplo n.º 1
0
 @Override
 public void visit(ERXML.Visitor visitor) {
   if (visitor.visit(this)) {
     for (ERXML.Item item : _children) {
       item.visit(visitor);
     }
   }
 }
Ejemplo 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;
 }
Ejemplo n.º 3
0
 @Override
 public void write(PrintWriter writer, int indent) {
   for (ERXML.Item item : _children) {
     item.write(writer, indent);
   }
 }
Ejemplo 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);
 }