类 CSVParser
java.lang.Object
com.sh.common.csv.CSVParser
Description: CSV文件解析
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
字段概要
字段修饰符和类型字段说明static final charstatic final booleanstatic final charstatic final charstatic final booleanstatic final intstatic final char -
构造器概要
构造器构造器说明默认构造函数CSVParser(char separator) Constructs CSVParser with supplied separator.CSVParser(char separator, char quotechar) Constructs CSVParser with supplied separator and quote char.CSVParser(char separator, char quotechar, char escape) Constructs CSVReader with supplied separator and quote char.CSVParser(char separator, char quotechar, char escape, boolean strictQuotes) Constructs CSVReader with supplied separator and quote char.CSVParser(char separator, char quotechar, char escape, boolean strictQuotes, boolean ignoreLeadingWhiteSpace) Constructs CSVReader with supplied separator and quote char. -
方法概要
修饰符和类型方法说明protected booleanprecondition: sb.length() > 0protected booleanisNextCharacterEscapable(String nextLine, boolean inQuotes, int i) precondition: the current character is an escapebooleanString[]String[]parseLineMulti(String nextLine)
-
字段详细资料
-
DEFAULT_SEPARATOR
public static final char DEFAULT_SEPARATOR- 另请参阅:
-
INITIAL_READ_SIZE
public static final int INITIAL_READ_SIZE- 另请参阅:
-
DEFAULT_QUOTE_CHARACTER
public static final char DEFAULT_QUOTE_CHARACTER- 另请参阅:
-
DEFAULT_ESCAPE_CHARACTER
public static final char DEFAULT_ESCAPE_CHARACTER- 另请参阅:
-
DEFAULT_STRICT_QUOTES
public static final boolean DEFAULT_STRICT_QUOTES- 另请参阅:
-
DEFAULT_IGNORE_LEADING_WHITESPACE
public static final boolean DEFAULT_IGNORE_LEADING_WHITESPACE- 另请参阅:
-
NULL_CHARACTER
public static final char NULL_CHARACTER- 另请参阅:
-
-
构造器详细资料
-
CSVParser
public CSVParser()默认构造函数 -
CSVParser
public CSVParser(char separator) Constructs CSVParser with supplied separator.- 参数:
separator- 分隔符
-
CSVParser
public CSVParser(char separator, char quotechar) Constructs CSVParser with supplied separator and quote char.- 参数:
separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elements
-
CSVParser
public CSVParser(char separator, char quotechar, char escape) Constructs CSVReader with supplied separator and quote char.- 参数:
separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quote
-
CSVParser
public CSVParser(char separator, char quotechar, char escape, boolean strictQuotes) Constructs CSVReader with supplied separator and quote char. Allows setting the "strict quotes" flag- 参数:
separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quotestrictQuotes- if true, characters outside the quotes are ignored
-
CSVParser
public CSVParser(char separator, char quotechar, char escape, boolean strictQuotes, boolean ignoreLeadingWhiteSpace) Constructs CSVReader with supplied separator and quote char. Allows setting the "strict quotes" and "ignore leading whitespace" flags- 参数:
separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quotestrictQuotes- if true, characters outside the quotes are ignoredignoreLeadingWhiteSpace- if true, white space in front of a quote in a field is ignored
-
-
方法详细资料
-
isPending
public boolean isPending()- 返回:
- true if something was left over from last call(s)
-
parseLineMulti
- 抛出:
IOException
-
parseLine
- 抛出:
IOException
-
isNextCharacterEscapable
precondition: the current character is an escape- 参数:
nextLine- the current lineinQuotes- true if the current context is quotedi- current index in line- 返回:
- true if the following character is a quote
-
isAllWhiteSpace
precondition: sb.length() > 0- 参数:
sb- A sequence of characters to examine- 返回:
- true if every character in the sequence is whitespace
-