| Modifier and Type | Field and Description |
|---|---|
| public static final char | DEFAULT_ESCAPE_CHARACTER
The default escape character to use if none is supplied to the constructor. |
| public static final boolean | DEFAULT_IGNORE_LEADING_WHITESPACE
The default leading whitespace behavior to use if none is supplied to the constructor |
| public static final char | DEFAULT_QUOTE_CHARACTER
The default quote character to use if none is supplied to the constructor. |
| public static final char | DEFAULT_SEPARATOR
The default separator to use if none is supplied to the constructor. |
| public static final boolean | DEFAULT_STRICT_QUOTES
The default strict quote behavior to use if none is supplied to the constructor |
| private final char | |
| private final boolean | |
| private boolean | |
| public static final int | |
| public static final char | NULL_CHARACTER
This is the "null" character - if a value is set to this then it is ignored. |
| private String | |
| private final char | |
| private final char | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CSVParser(char
the delimiter to use for separating entries. separator)Constructs CSVParser with supplied separator. |
| public | CSVParser(char
the delimiter to use for separating entries separator, char the character to use for quoted elements quotechar)Constructs CSVParser with supplied separator and quote char. |
| public | CSVParser(char
the delimiter to use for separating entries separator, char the character to use for quoted elements quotechar, char the character to use for escaping a separator or quote escape)Constructs CSVReader with supplied separator and quote char. |
| public | CSVParser(char
the delimiter to use for separating entries separator, char the character to use for quoted elements quotechar, char the character to use for escaping a separator or quote escape, boolean if true, characters outside the quotes are ignored strictQuotes)Constructs CSVReader with supplied separator and quote char. |
| public | CSVParser(char
the delimiter to use for separating entries separator, char the character to use for quoted elements quotechar, char the character to use for escaping a separator or quote escape, boolean if true, characters outside the quotes are ignored strictQuotes, boolean if true, white space in front of a quote
in a field is ignored ignoreLeadingWhiteSpace)Constructs CSVReader with supplied separator and quote char. |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| protected boolean | Returns: true if every character in the sequence is whitespaceA sequence of characters to examine sb)precondition: sb.length() > 0 |
| protected boolean | Returns: true if the following character is a quotethe current line nextLine, boolean true if the current context is quoted inQuotes, int current index in line i)precondition: the current character is an escape |
| private boolean | Returns: true if the following character is a quotethe current line nextLine, boolean true if the current context is quoted inQuotes, int current index in line i)precondition: the current character is a quote or an escape |
| public boolean | |
| private static boolean | |
| public String[] | |
| private String[] | |
| public String[] |
| DEFAULT_ESCAPE_CHARACTER | back to summary |
|---|---|
| public static final char DEFAULT_ESCAPE_CHARACTER The default escape character to use if none is supplied to the constructor. | |
| DEFAULT_IGNORE_LEADING_WHITESPACE | back to summary |
|---|---|
| public static final boolean DEFAULT_IGNORE_LEADING_WHITESPACE The default leading whitespace behavior to use if none is supplied to the constructor | |
| DEFAULT_QUOTE_CHARACTER | back to summary |
|---|---|
| public static final char DEFAULT_QUOTE_CHARACTER The default quote character to use if none is supplied to the constructor. | |
| DEFAULT_SEPARATOR | back to summary |
|---|---|
| public static final char DEFAULT_SEPARATOR The default separator to use if none is supplied to the constructor. | |
| DEFAULT_STRICT_QUOTES | back to summary |
|---|---|
| public static final boolean DEFAULT_STRICT_QUOTES The default strict quote behavior to use if none is supplied to the constructor | |
| escape | back to summary |
|---|---|
| private final char escape | |
| ignoreLeadingWhiteSpace | back to summary |
|---|---|
| private final boolean ignoreLeadingWhiteSpace | |
| inField | back to summary |
|---|---|
| private boolean inField | |
| INITIAL_READ_SIZE | back to summary |
|---|---|
| public static final int INITIAL_READ_SIZE | |
| NULL_CHARACTER | back to summary |
|---|---|
| public static final char NULL_CHARACTER This is the "null" character - if a value is set to this then it is ignored. I.E. if the quote character is set to null then there is no quote character. | |
| pending | back to summary |
|---|---|
| private String pending | |
| quotechar | back to summary |
|---|---|
| private final char quotechar | |
| separator | back to summary |
|---|---|
| private final char separator | |
| strictQuotes | back to summary |
|---|---|
| private final boolean strictQuotes | |
| CSVParser | back to summary |
|---|---|
| public CSVParser() Constructs CSVParser using a comma for the separator. | |
| CSVParser | back to summary |
|---|---|
| public CSVParser(char separator) Constructs CSVParser with supplied separator.
| |
| CSVParser | back to summary |
|---|---|
| public CSVParser(char separator, char quotechar) Constructs CSVParser with supplied separator and quote char.
| |
| CSVParser | back to summary |
|---|---|
| public CSVParser(char separator, char quotechar, char escape) Constructs CSVReader with supplied separator and quote char.
| |
| CSVParser | back to summary |
|---|---|
| public CSVParser(char separator, char quotechar, char escape, boolean strictQuotes) Constructs CSVReader with supplied separator and quote char. Allows setting the "strict quotes" flag
| |
| CSVParser | back to summary |
|---|---|
| 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
| |
| anyCharactersAreTheSame | back to summary |
|---|---|
| private static boolean anyCharactersAreTheSame(char separator, char quotechar, char escape) | |
| isAllWhiteSpace | back to summary |
|---|---|
| protected boolean isAllWhiteSpace(CharSequence sb) precondition: sb.length() > 0
| |
| isNextCharacterEscapable | back to summary |
|---|---|
| protected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i) precondition: the current character is an escape
| |
| isNextCharacterEscapedQuote | back to summary |
|---|---|
| private boolean isNextCharacterEscapedQuote(String nextLine, boolean inQuotes, int i) precondition: the current character is a quote or an escape
| |
| isPending | back to summary |
|---|---|
public boolean isPending()
| |
| isSameCharacter | back to summary |
|---|---|
| private static boolean isSameCharacter(char c1, char c2) | |
| parseLine | back to summary |
|---|---|
| public String[] parseLine(String nextLine) throws IOException | |
| parseLine | back to summary |
|---|---|
| private String[] parseLine(String nextLine, boolean multi) throws IOException Parses an incoming String and returns an array of elements.
| |
| parseLineMulti | back to summary |
|---|---|
| public String[] parseLineMulti(String nextLine) throws IOException | |