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) |
static <E> void |
exportToFile(ExportModel<E> model,
Iterable<E> data,
File file,
Charset charset,
boolean writeHeader) |
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> String |
exportToString(ExportModel<E> model,
Iterable<E> data,
Charset charset,
boolean writeHeader) |
static <E> void |
exportToWriter(ExportModel<E> model,
Iterable<E> data,
Writer writer) |
static <E> void |
exportToWriter(ExportModel<E> model,
Iterable<E> data,
Writer writer,
boolean writeHeader) |
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) |
String |
toString(Charset charset,
boolean writeHeader) |
void |
write(File file) |
void |
write(File file,
boolean writeHeader) |
void |
write(File file,
Charset charset) |
void |
write(File file,
Charset charset,
boolean writeHeader) |
void |
write(OutputStream outputStream) |
void |
write(OutputStream outputStream,
boolean writeHeader) |
void |
write(OutputStream outputStream,
Charset charset) |
void |
write(OutputStream outputStream,
Charset charset,
boolean writeHeader) |
void |
write(Writer writer) |
void |
write(Writer writer,
boolean writeHeader) |
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 exportToWriter(ExportModel<E> model, Iterable<E> data, Writer writer, boolean writeHeader) 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> void exportToFile(ExportModel<E> model, Iterable<E> data, File file, Charset charset, boolean writeHeader) 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
Exceptionpublic static <E> String exportToString(ExportModel<E> model, Iterable<E> data, Charset charset, boolean writeHeader) 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, Charset charset, boolean writeHeader) throws Exception
Exceptionpublic void write(OutputStream outputStream) throws Exception
Exceptionpublic void write(OutputStream outputStream, boolean writeHeader) throws Exception
Exceptionpublic void write(File file, Charset charset, boolean writeHeader) throws Exception
Exceptionpublic String toString(Charset charset, boolean writeHeader) 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-2013 CodeLutin. All Rights Reserved.