类 CSVWriter
java.lang.Object
com.sh.common.csv.CSVWriter
- 所有已实现的接口:
Closeable,AutoCloseable
Description: 生成CSV文件
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
字段概要
字段修饰符和类型字段说明static final charstatic final Stringstatic final charstatic final charstatic final intstatic final charstatic final char -
构造器概要
构造器构造器说明Constructs CSVWriter using a comma for the separator.Constructs CSVWriter with supplied separator.Constructs CSVWriter with supplied separator and quote char.Constructs CSVWriter with supplied separator and quote char.Constructs CSVWriter with supplied separator, quote char, escape char and line ending.Constructs CSVWriter with supplied separator and quote char. -
方法概要
修饰符和类型方法说明booleanChecks to see if the there has been an error in the printstream.voidclose()关闭流及缓存空间 Close the underlying stream writer flushing any buffered content.voidflush()刷新输出流protected StringBuilderprocessLine(String nextElement) voidsetResultService(ResultSetHelper resultService) void将ResultSet中的数据写入CSV文件中void将list中的数据写入CSV文件protected voidvoid加入新的一行
-
字段详细资料
-
INITIAL_STRING_SIZE
public static final int INITIAL_STRING_SIZE- 另请参阅:
-
DEFAULT_ESCAPE_CHARACTER
public static final char DEFAULT_ESCAPE_CHARACTER- 另请参阅:
-
DEFAULT_SEPARATOR
public static final char DEFAULT_SEPARATOR- 另请参阅:
-
DEFAULT_QUOTE_CHARACTER
public static final char DEFAULT_QUOTE_CHARACTER- 另请参阅:
-
NO_QUOTE_CHARACTER
public static final char NO_QUOTE_CHARACTER- 另请参阅:
-
NO_ESCAPE_CHARACTER
public static final char NO_ESCAPE_CHARACTER- 另请参阅:
-
DEFAULT_LINE_END
- 另请参阅:
-
-
构造器详细资料
-
CSVWriter
Constructs CSVWriter using a comma for the separator.- 参数:
writer- the writer to an underlying CSV source.
-
CSVWriter
Constructs CSVWriter with supplied separator.- 参数:
writer- the writer to an underlying CSV source.separator- the delimiter to use for separating entries.
-
CSVWriter
Constructs CSVWriter with supplied separator and quote char.- 参数:
writer- the writer to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elements
-
CSVWriter
Constructs CSVWriter with supplied separator and quote char.- 参数:
writer- the writer to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescapechar- the character to use for escaping quotechars or escapechars
-
CSVWriter
Constructs CSVWriter with supplied separator and quote char.- 参数:
writer- the writer to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementslineEnd- the line feed terminator to use
-
CSVWriter
Constructs CSVWriter with supplied separator, quote char, escape char and line ending.- 参数:
writer- the writer to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescapechar- the character to use for escaping quotechars or escapecharslineEnd- the line feed terminator to use
-
-
方法详细资料
-
writeAll
将list中的数据写入CSV文件- 参数:
allLines- 存放String[]对象的List对象
-
writeColumnNames
- 抛出:
SQLException
-
writeAll
将ResultSet中的数据写入CSV文件中- 参数:
rs- the recordset to writeincludeColumnNames- true if you want column names in the output, false otherwise- 抛出:
SQLException- SQLExceptionIOException- IOException
-
writeNext
加入新的一行- 参数:
nextLine- a string array with each comma-separated element as a separate entry
-
processLine
-
flush
刷新输出流- 抛出:
IOException- IOException
-
close
关闭流及缓存空间 Close the underlying stream writer flushing any buffered content.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 抛出:
IOException- IOException
-
checkError
public boolean checkError()Checks to see if the there has been an error in the printstream.- 返回:
- boolean
-
setResultService
-