// Path: src/main/java/org/dynaform/xml/XmlVisitor.java
// public interface XmlVisitor {
// 
//   /**
//    * Handle text.
//    * 
//    * @param s text.
//    * @return XML event handler to be used as next.
//    */
//   XmlVisitor text(String s);
// 
//   /**
//    * Handle XML element start.
//    * 
//    * @param element name of the XML element.
//    * @return event handler for the XML element.
//    */
//   ElementVisitor visitElement(String element);
//   
//   /**
//    * Handle end of the XML element body.
//    * 
//    * @return event handler of the XML element to be used as next.
//    */
//   ElementVisitor visitEndBody();
// 
//   /**
//    * Event handler of XML element.
//    * 
//    * @author Rein Raudjärv
//    */
//   interface ElementVisitor {
//     /**
//      * Handle XML attribute.
//      * 
//      * @param name name of the XML attribute.
//      * @param value value of the XML attribute.
//      * @return event handler for the XML element.
//      */
//     ElementVisitor visitAttribute(String name, String value);
// 
//     /**
//      * Handle start of the XML body.
//      * 
//      * @return event handler for the XML element body.
//      */
//     XmlVisitor visitBody();
// 
//     /**
//      * Handle end of the XML element.
//      * 
//      * @return XML event handler to be used as next.
//      */
//     XmlVisitor visitEndElement();
//   }
// 
// }


import org.dynaform.xml.RepeatAdapter;
import org.dynaform.xml.XmlForm;
import org.dynaform.xml.XmlVisitor;
import org.dynaform.xml.form.FormRepeat;

package org.dynaform.xml.writer;


/**
 * @author Rein Raudjärv
 * 
 * @see FormRepeat
 * @see RepeatAdapter
 * @see XmlWriter
 */
public class RepeatWriter implements XmlWriter {

  private final RepeatAdapter<?> adapter;

  public RepeatWriter(RepeatAdapter<?> adapter) {
    this.adapter = adapter;
  }

  public boolean isEmpty() {
    return adapter.getChildren().isEmpty();
  }


// Path: src/main/java/org/dynaform/xml/XmlVisitor.java
// public interface XmlVisitor {
// 
//   /**
//    * Handle text.
//    * 
//    * @param s text.
//    * @return XML event handler to be used as next.
//    */
//   XmlVisitor text(String s);
// 
//   /**
//    * Handle XML element start.
//    * 
//    * @param element name of the XML element.
//    * @return event handler for the XML element.
//    */
//   ElementVisitor visitElement(String element);
//   
//   /**
//    * Handle end of the XML element body.
//    * 
//    * @return event handler of the XML element to be used as next.
//    */
//   ElementVisitor visitEndBody();
// 
//   /**
//    * Event handler of XML element.
//    * 
//    * @author Rein Raudjärv
//    */
//   interface ElementVisitor {
//     /**
//      * Handle XML attribute.
//      * 
//      * @param name name of the XML attribute.
//      * @param value value of the XML attribute.
//      * @return event handler for the XML element.
//      */
//     ElementVisitor visitAttribute(String name, String value);
// 
//     /**
//      * Handle start of the XML body.
//      * 
//      * @return event handler for the XML element body.
//      */
//     XmlVisitor visitBody();
// 
//     /**
//      * Handle end of the XML element.
//      * 
//      * @return XML event handler to be used as next.
//      */
//     XmlVisitor visitEndElement();
//   }
// 
// }


// Path: src/main/java/org/dynaform/xml/writer/RepeatWriter.java
import org.dynaform.xml.RepeatAdapter;
import org.dynaform.xml.XmlForm;
import org.dynaform.xml.XmlVisitor;
import org.dynaform.xml.form.FormRepeat;

package org.dynaform.xml.writer;


/**
 * @author Rein Raudjärv
 * 
 * @see FormRepeat
 * @see RepeatAdapter
 * @see XmlWriter
 */
public class RepeatWriter implements XmlWriter {

  private final RepeatAdapter<?> adapter;

  public RepeatWriter(RepeatAdapter<?> adapter) {
    this.adapter = adapter;
  }

  public boolean isEmpty() {
    return adapter.getChildren().isEmpty();
  }


  public void write(XmlVisitor xa) {
