Class DataWriter
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.io.DataWriter
Writes dyna beans matching a specified database model into an XML file.
TODO: Make names (tables, columns) XML-compliant
- Version:
- $Revision: 289996 $
-
Constructor Summary
ConstructorsConstructorDescriptionDataWriter
(OutputStream output) Creates a data writer instance using UTF-8 encoding.DataWriter
(OutputStream output, String encoding) Creates a data writer instance.DataWriter
(Writer output, String encoding) Creates a data writer instance using the specified writer. -
Method Summary
Modifier and TypeMethodDescriptionReturns the converter configuration of this data reader.boolean
Determines whether the output shall be pretty-printed.void
setPrettyPrinting
(boolean prettyPrinting) Specifies whether the output shall be pretty-printed.void
write
(SqlDynaBean bean) Writes the given bean.void
write
(Collection beans) Writes the beans contained in the given collection.void
Writes the beans contained in the given iterator.void
Writes the end of the XML document, i.e.void
Writes the start of the XML document, i.e.
-
Constructor Details
-
DataWriter
Creates a data writer instance using UTF-8 encoding.- Parameters:
output
- The target to write the data XML to- Throws:
DataWriterException
-
DataWriter
Creates a data writer instance.- Parameters:
output
- The target to write the data XML toencoding
- The encoding of the XML file- Throws:
DataWriterException
-
DataWriter
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 toencoding
- 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
Returns the converter configuration of this data reader.- Returns:
- The converter configuration
-
writeDocumentStart
Writes the start of the XML document, i.e. the "<?xml?>" section and the start of the root node.- Throws:
DataWriterException
-
writeDocumentEnd
Writes the end of the XML document, i.e. end of the root node.- Throws:
DataWriterException
-
write
Writes the given bean.- Parameters:
bean
- The bean to write- Throws:
DataWriterException
-
write
Writes the beans contained in the given iterator.- Parameters:
beans
- The beans iterator- Throws:
DataWriterException
-
write
Writes the beans contained in the given collection.- Parameters:
beans
- The beans- Throws:
DataWriterException
-