|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jmatchparser.util.csv.AbstractCSVWriter
net.sf.jmatchparser.util.csv.FixedWidthCSVWriter
public class FixedWidthCSVWriter
Class to create fixed width CSV (Comma Separated Value) files, where every column has a fixed width and may optionally additionally delimited by separator characters.
| Constructor Summary | |
|---|---|
FixedWidthCSVWriter(OutputStream out,
String charsetName,
FixedWidthColumn... columns)
Create a new CSV writer that writes to the given stream in the given charset using the given columns and no separators. |
|
FixedWidthCSVWriter(OutputStream out,
String charsetName,
int... widths)
Create a new CSV writer that writes to the given stream in the given charset using left-aligned space-padded columns only and no separators. |
|
FixedWidthCSVWriter(OutputStream out,
String charsetName,
String... columnSpecs)
Create a new CSV writer that writes to the given stream in the given charset using columns parsed from the given column specs and no separators. |
|
FixedWidthCSVWriter(OutputStream out,
String charsetName,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Create a new CSV writer that writes to the given stream in the given charset using the given columns and separators. |
|
FixedWidthCSVWriter(Writer w,
FixedWidthColumn... columns)
Create a new CSV writer that writes to the given Writer using the
given columns and no separators. |
|
FixedWidthCSVWriter(Writer w,
int... widths)
Create a new CSV writer that writes to the given Writer using
left-aligned space-padded columns only and no separators. |
|
FixedWidthCSVWriter(Writer w,
String... columnSpecs)
Create a new CSV writer that writes to the given Writer using
columns parsed from the given column specs and no separators. |
|
FixedWidthCSVWriter(Writer w,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Create a new CSV writer that writes to the given Writer using the
given columns and separators. |
|
| Method Summary | |
|---|---|
void |
close()
Close this CSV writer. |
void |
flush()
Flush this CSV writer. |
void |
setTruncateValues(boolean truncateValues)
Set whether overlong values should be truncated automatically. |
void |
write(String... record)
Write a record (line) into this CSV file. |
| Methods inherited from class net.sf.jmatchparser.util.csv.AbstractCSVWriter |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedWidthCSVWriter(Writer w,
int... widths)
Writer using
left-aligned space-padded columns only and no separators.
w - the writer to write to.widths - The width of each column
public FixedWidthCSVWriter(Writer w,
String... columnSpecs)
Writer using
columns parsed from the given column specs and no separators.
w - the writer to write to.columnSpecs - The format specification of each column
public FixedWidthCSVWriter(Writer w,
FixedWidthColumn... columns)
Writer using the
given columns and no separators.
w - the writer to write to.columns - The format of each column
public FixedWidthCSVWriter(Writer w,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Writer using the
given columns and separators.
w - the writer to write to.prefix - The prefix to add to each lineseparator - The separator to add between each fieldsuffix - The suffix to add to each linecolumns - The format of each column
public FixedWidthCSVWriter(OutputStream out,
String charsetName,
int... widths)
throws UnsupportedEncodingException
out - Output streamcharsetName - charsetwidths - The width of each column
UnsupportedEncodingException
public FixedWidthCSVWriter(OutputStream out,
String charsetName,
String... columnSpecs)
throws UnsupportedEncodingException
out - Output streamcharsetName - charsetcolumnSpecs - The format specification of each column
UnsupportedEncodingException
public FixedWidthCSVWriter(OutputStream out,
String charsetName,
FixedWidthColumn... columns)
throws UnsupportedEncodingException
out - Output streamcharsetName - charsetcolumns - The format of each column
UnsupportedEncodingException
public FixedWidthCSVWriter(OutputStream out,
String charsetName,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
throws UnsupportedEncodingException
out - Output streamcharsetName - charsetprefix - The prefix to add to each lineseparator - The separator to add between each fieldsuffix - The suffix to add to each linecolumns - The format of each column
UnsupportedEncodingException| Method Detail |
|---|
public void flush()
throws IOException
AbstractCSVWriter
flush in class AbstractCSVWriterIOException
public void close()
throws IOException
AbstractCSVWriter
close in class AbstractCSVWriterIOExceptionpublic void setTruncateValues(boolean truncateValues)
public void write(String... record)
throws IOException
AbstractCSVWriter
write in class AbstractCSVWriterIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||