java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.io.DataWriter

public class DataWriter extends Object
Writes dyna beans matching a specified database model into an XML file. TODO: Make names (tables, columns) XML-compliant
Version:
$Revision: 289996 $
  • Constructor Details

    • DataWriter

      public DataWriter(OutputStream output) throws DataWriterException
      Creates a data writer instance using UTF-8 encoding.
      Parameters:
      output - The target to write the data XML to
      Throws:
      DataWriterException
    • DataWriter

      public DataWriter(OutputStream output, String encoding) throws DataWriterException
      Creates a data writer instance.
      Parameters:
      output - The target to write the data XML to
      encoding - The encoding of the XML file
      Throws:
      DataWriterException
    • DataWriter

      public DataWriter(Writer output, String encoding) throws DataWriterException
      Creates a data writer instance using the specified writer. Note that the writer needs to be configured using the specified encoding.
      Parameters:
      output - The target to write the data XML to
      encoding - The encoding of the writer
      Throws:
      DataWriterException
  • Method Details

    • isPrettyPrinting

      public boolean isPrettyPrinting()
      Determines whether the output shall be pretty-printed.
      Returns:
      true if the output is pretty-printed
    • setPrettyPrinting

      public void setPrettyPrinting(boolean prettyPrinting)
      Specifies whether the output shall be pretty-printed.
      Parameters:
      prettyPrinting - true if the output is pretty-printed
    • getConverterConfiguration

      public ConverterConfiguration getConverterConfiguration()
      Returns the converter configuration of this data reader.
      Returns:
      The converter configuration
    • writeDocumentStart

      public void writeDocumentStart() throws DataWriterException
      Writes the start of the XML document, i.e. the "<?xml?>" section and the start of the root node.
      Throws:
      DataWriterException
    • writeDocumentEnd

      public void writeDocumentEnd() throws DataWriterException
      Writes the end of the XML document, i.e. end of the root node.
      Throws:
      DataWriterException
    • write

      public void write(SqlDynaBean bean) throws DataWriterException
      Writes the given bean.
      Parameters:
      bean - The bean to write
      Throws:
      DataWriterException
    • write

      public void write(Iterator beans) throws DataWriterException
      Writes the beans contained in the given iterator.
      Parameters:
      beans - The beans iterator
      Throws:
      DataWriterException
    • write

      public void write(Collection beans) throws DataWriterException
      Writes the beans contained in the given collection.
      Parameters:
      beans - The beans
      Throws:
      DataWriterException