< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java

Print this page




  60  * optionally indented if an indent step is provided (by default, there
  61  * is no indentation).  If an element contains other elements, the end
  62  * tag will also appear on a new line with leading indentation.  Consider,
  63  * for example, the following code:</p>
  64  *
  65  * <pre>
  66  * DataWriter w = new DataWriter();
  67  *
  68  * w.setIndentStep(2);
  69  * w.startDocument();
  70  * w.startElement("Person");
  71  * w.dataElement("name", "Jane Smith");
  72  * w.dataElement("date-of-birth", "1965-05-23");
  73  * w.dataElement("citizenship", "US");
  74  * w.endElement("Person");
  75  * w.endDocument();
  76  * </pre>
  77  *
  78  * <p>This code will produce the following document:</p>
  79  *
  80  * <pre>
  81  * &lt;?xml version="1.0" standalone="yes"?>
  82  *
  83  * &lt;Person>
  84  *   &lt;name>Jane Smith&lt;/name>
  85  *   &lt;date-of-birth>1965-05-23&lt;/date-of-birth>
  86  *   &lt;citizenship>US&lt;/citizenship>
  87  * &lt;/Person>
  88  * </pre>
  89  *
  90  * <p>This class inherits from {@link XMLWriter},
  91  * and provides all of the same support for Namespaces.</p>
  92  *
  93  * @since 1.0
  94  * @author David Megginson, david@megginson.com
  95  * @version 0.2
  96  * @see XMLWriter
  97  */
  98 public class DataWriter extends XMLWriter
  99 {
 100 
 101 
 102 
 103     ////////////////////////////////////////////////////////////////////
 104     // Constructors.
 105     ////////////////////////////////////////////////////////////////////
 106 
 107 
 108     /**




  60  * optionally indented if an indent step is provided (by default, there
  61  * is no indentation).  If an element contains other elements, the end
  62  * tag will also appear on a new line with leading indentation.  Consider,
  63  * for example, the following code:</p>
  64  *
  65  * <pre>
  66  * DataWriter w = new DataWriter();
  67  *
  68  * w.setIndentStep(2);
  69  * w.startDocument();
  70  * w.startElement("Person");
  71  * w.dataElement("name", "Jane Smith");
  72  * w.dataElement("date-of-birth", "1965-05-23");
  73  * w.dataElement("citizenship", "US");
  74  * w.endElement("Person");
  75  * w.endDocument();
  76  * </pre>
  77  *
  78  * <p>This code will produce the following document:</p>
  79  *
  80  * <pre>{@code
  81  * <?xml version="1.0" standalone="yes"?>
  82  *
  83  * <Person>
  84  *   <name>Jane Smith</name>
  85  *   <date-of-birth>1965-05-23</date-of-birth>
  86  *   <citizenship>US</citizenship>
  87  * </Person>
  88  * }</pre>
  89  *
  90  * <p>This class inherits from {@link XMLWriter},
  91  * and provides all of the same support for Namespaces.</p>
  92  *
  93  * @since 1.0
  94  * @author David Megginson, david@megginson.com
  95  * @version 0.2
  96  * @see XMLWriter
  97  */
  98 public class DataWriter extends XMLWriter
  99 {
 100 
 101 
 102 
 103     ////////////////////////////////////////////////////////////////////
 104     // Constructors.
 105     ////////////////////////////////////////////////////////////////////
 106 
 107 
 108     /**


< prev index next >