public class FlatXmlWriter extends Object implements IDataSetConsumer
Constructor and Description |
---|
FlatXmlWriter(OutputStream out) |
FlatXmlWriter(OutputStream outputStream,
String encoding) |
FlatXmlWriter(Writer writer) |
FlatXmlWriter(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.
|
void |
row(Object[] values)
Receive notification of a table row.
|
void |
setDocType(String systemId) |
void |
setIncludeEmptyTable(boolean includeEmptyTable) |
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. |
public FlatXmlWriter(OutputStream out) throws IOException
IOException
public FlatXmlWriter(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)
.UnsupportedEncodingException
public FlatXmlWriter(Writer writer)
public void setIncludeEmptyTable(boolean includeEmptyTable)
public void setDocType(String systemId)
public void setPrettyPrint(boolean enabled)
enabled
- true
to enable pretty print (which is the default).
false
otherwise.public void write(IDataSet dataSet) throws DataSetException
IDataSet
using this writer.dataSet
- The IDataSet
to be writtenDataSetException
public void startDataSet() throws DataSetException
IDataSetConsumer
startDataSet
in interface IDataSetConsumer
DataSetException
public void endDataSet() throws DataSetException
IDataSetConsumer
endDataSet
in interface IDataSetConsumer
DataSetException
public void startTable(ITableMetaData metaData) throws DataSetException
IDataSetConsumer
IDataSetConsumer.endDataSet()
event for every startTable
event (even when the table is empty).startTable
in interface IDataSetConsumer
metaData
- the table metadataDataSetException
public void endTable() throws DataSetException
IDataSetConsumer
endTable
in interface IDataSetConsumer
DataSetException
public void row(Object[] values) throws DataSetException
IDataSetConsumer
row
in interface IDataSetConsumer
values
- The row values.DataSetException
Copyright © 2002–2020. All rights reserved.