public class Export<E> extends Object
ExportModel and some datas.
Export.exportToFile(model, data, file);
Export.exportToWriter(model, data, writer);
String exportcontent = Export.exportToString(model, data);
Export<E> exporter = Export.newExport(model, data);
| Modifier and Type | Field and Description |
|---|---|
protected Iterable<E> |
data
Data to export.
|
protected ExportModel<E> |
model
Export model.
|
protected String |
separator
Cell separator.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Export(ExportModel<E> model,
Iterable<E> data) |
| Modifier and Type | Method and Description |
|---|---|
static <E> void |
exportToFile(ExportModel<E> model,
Iterable<E> data,
File file) |
static <E> void |
exportToFile(ExportModel<E> model,
Iterable<E> data,
File file,
Charset charset) |
void |
exportToFile(File file)
Deprecated.
since 2.4.3, use
write(java.io.File) instead. |
static <E> String |
exportToString(ExportModel<E> model,
Iterable<E> data) |
static <E> String |
exportToString(ExportModel<E> model,
Iterable<E> data,
Charset charset) |
static <E> void |
exportToWriter(ExportModel<E> model,
Iterable<E> data,
Writer writer) |
static <E> Export<E> |
newExport(ExportModel<E> model,
Iterable<E> data) |
InputStream |
startExport()
Deprecated.
since 2.4.3. It's not the role of the API to give an InputStream
you can use
toString(java.nio.charset.Charset) and
IOUtils.toInputStream(String) |
void |
startExport(Writer writer)
Deprecated.
since 2.4.3, use
write(java.io.Writer) instead. |
String |
startExportAsString()
Deprecated.
since 2.4.3, use
toString(java.nio.charset.Charset) instead. |
String |
toString(Charset charset) |
void |
write(File file) |
void |
write(File file,
Charset charset) |
void |
write(OutputStream outputStream) |
void |
write(OutputStream outputStream,
Charset charset) |
void |
write(Writer writer) |
protected void |
writeHeader(Writer writer) |
protected void |
writeRow(Writer writer,
Iterable<ExportableColumn<E,Object>> columns,
E row) |
protected final ExportModel<E> model
protected final String separator
ExportModel.getSeparator()protected Export(ExportModel<E> model, Iterable<E> data)
public static <E> Export<E> newExport(ExportModel<E> model, Iterable<E> data)
public static <E> void exportToWriter(ExportModel<E> model, Iterable<E> data, Writer writer) throws Exception
Exceptionpublic static <E> void exportToFile(ExportModel<E> model, Iterable<E> data, File file) throws Exception
Exceptionpublic static <E> void exportToFile(ExportModel<E> model, Iterable<E> data, File file, Charset charset) throws Exception
Exceptionpublic static <E> String exportToString(ExportModel<E> model, Iterable<E> data) throws Exception
Exceptionpublic static <E> String exportToString(ExportModel<E> model, Iterable<E> data, Charset charset) throws Exception
Exceptionprotected void writeHeader(Writer writer) throws IOException
IOExceptionprotected void writeRow(Writer writer, Iterable<ExportableColumn<E,Object>> columns, E row) throws Exception
Exceptionpublic void write(OutputStream outputStream, Charset charset) throws Exception
Exceptionpublic void write(OutputStream outputStream) throws Exception
Exception@Deprecated public void exportToFile(File file) throws Exception
write(java.io.File) instead.Exception@Deprecated public void startExport(Writer writer) throws Exception
write(java.io.Writer) instead.Exception@Deprecated public String startExportAsString() throws Exception
toString(java.nio.charset.Charset) instead.Exception@Deprecated public InputStream startExport() throws Exception
toString(java.nio.charset.Charset) and
IOUtils.toInputStream(String)ExceptionCopyright © 2011-2012 CodeLutin. All Rights Reserved.