public class XmlDataSetWriter extends Object implements IDataSetConsumer
| Constructor and Description |
|---|
XmlDataSetWriter(OutputStream outputStream,
String encoding) |
XmlDataSetWriter(Writer writer) |
XmlDataSetWriter(Writer writer,
String encoding) |
| Modifier and Type | Method and Description |
|---|---|
void |
endDataSet()
Receive notification of the end of a dataset.
|
void |
endTable()
Receive notification of the end of a table.
|
protected XmlWriter |
getXmlWriter() |
void |
row(Object[] values)
Receive notification of a table row.
|
void |
setIncludeColumnComments(boolean includeColumnComments)
Whether or not to write the column name as comment into the XML
|
void |
setPrettyPrint(boolean enabled)
Enable or disable pretty print of the XML.
|
void |
startDataSet()
Receive notification of the beginning of a dataset.
|
void |
startTable(ITableMetaData metaData)
Receive notification of the beginning of a table.
|
void |
write(IDataSet dataSet)
Writes the given
IDataSet using this writer. |
protected void |
writeValue(String stringValue)
Writes the given String as normal text using the
XmlWriter. |
protected void |
writeValueCData(String stringValue)
Writes the given String as CDATA using the
XmlWriter. |
public XmlDataSetWriter(OutputStream outputStream, String encoding) throws UnsupportedEncodingException
outputStream - The stream to which the XML will be written.encoding - The encoding to be used for the XmlWriter.
Can be null. See XmlWriter.XmlWriter(OutputStream, String).UnsupportedEncodingExceptionpublic XmlDataSetWriter(Writer writer)
public void setPrettyPrint(boolean enabled)
enabled - true to enable pretty print (which is the default).
false otherwise.public void setIncludeColumnComments(boolean includeColumnComments)
includeColumnComments - Whether or not to write the column name as comment into the XMLpublic void write(IDataSet dataSet) throws DataSetException
IDataSet using this writer.dataSet - The IDataSet to be writtenDataSetExceptionpublic void startDataSet()
throws DataSetException
IDataSetConsumerstartDataSet in interface IDataSetConsumerDataSetExceptionpublic void endDataSet()
throws DataSetException
IDataSetConsumerendDataSet in interface IDataSetConsumerDataSetExceptionpublic void startTable(ITableMetaData metaData) throws DataSetException
IDataSetConsumerIDataSetConsumer.endDataSet() event for every startTable
event (even when the table is empty).startTable in interface IDataSetConsumermetaData - the table metadataDataSetExceptionpublic void endTable()
throws DataSetException
IDataSetConsumerendTable in interface IDataSetConsumerDataSetExceptionpublic void row(Object[] values) throws DataSetException
IDataSetConsumerrow in interface IDataSetConsumervalues - The row values.DataSetExceptionprotected void writeValueCData(String stringValue) throws IOException
XmlWriter.
Can be overridden to add custom behavior.
This implementation just invokes XmlWriter.writeCData(String)stringValue - The value to be writtenIOExceptionprotected void writeValue(String stringValue) throws IOException
XmlWriter.
Can be overridden to add custom behavior.
This implementation just invokes XmlWriter.writeText(String).stringValue - The value to be writtenIOExceptionCopyright © 2002-2017. All Rights Reserved.