Class SimpleXmlWriter


public class SimpleXmlWriter extends TextWriter
Writes XML in the following simple format.
  • Constructor Details

    • SimpleXmlWriter

      public SimpleXmlWriter(File file)
    • SimpleXmlWriter

      public SimpleXmlWriter(Writer writer)
  • Method Details

    • isPretty

      public boolean isPretty()
      Indicates if line breaks and indentations should be added to output (default false).
    • setPretty

      public SimpleXmlWriter setPretty(boolean pretty)
      Indicates if line breaks and indentations should be added to output (default false).
      Example output (pretty = true):
      <?xml version="1.0" ?>
      <records>
        <record>
          <field name="country">Philippines</field>
        </record>
      </records>

      Example output (pretty = false):
      <?xml version="1.0" ?><records><record><field name="country">Philippines</field></record></records>
    • open

      public void open()
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class AbstractWriter
    • close

      public void close()
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class TextWriter
    • writeRecord

      protected void writeRecord(Record record) throws Throwable
      Description copied from class: AbstractWriter
      Writes one row; called first for the header row (see AbstractWriter.isHeaderRow()) when field names are written, then for each record.
      Specified by:
      writeRecord in class AbstractWriter
      Throws:
      Throwable