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