mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-17 15:35:46 +00:00
Method names should start with a verb
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1460136 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9bafed6b23
commit
c4014b6b38
@ -112,7 +112,7 @@ final class CSVLexer extends Lexer {
|
|||||||
token.type = EORECORD;
|
token.type = EORECORD;
|
||||||
} else if (isQuoteChar(c)) {
|
} else if (isQuoteChar(c)) {
|
||||||
// consume encapsulated token
|
// consume encapsulated token
|
||||||
encapsulatedTokenLexer(token);
|
parseEncapsulatedToken(token);
|
||||||
} else if (isEndOfFile(c)) {
|
} else if (isEndOfFile(c)) {
|
||||||
// end of file return EOF()
|
// end of file return EOF()
|
||||||
// noop: tkn.content.append("");
|
// noop: tkn.content.append("");
|
||||||
@ -121,14 +121,14 @@ final class CSVLexer extends Lexer {
|
|||||||
} else {
|
} else {
|
||||||
// next token must be a simple token
|
// next token must be a simple token
|
||||||
// add removed blanks when not ignoring whitespace chars...
|
// add removed blanks when not ignoring whitespace chars...
|
||||||
simpleTokenLexer(token, c);
|
parseSimpleToken(token, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple token lexer
|
* Parsed a simple token.
|
||||||
* <p/>
|
* <p/>
|
||||||
* Simple token are tokens which are not surrounded by encapsulators. A simple token might contain escaped
|
* Simple token are tokens which are not surrounded by encapsulators. A simple token might contain escaped
|
||||||
* delimiters (as \, or \;). The token is finished when one of the following conditions become true:
|
* delimiters (as \, or \;). The token is finished when one of the following conditions become true:
|
||||||
@ -146,7 +146,7 @@ final class CSVLexer extends Lexer {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* on stream access error
|
* on stream access error
|
||||||
*/
|
*/
|
||||||
private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
|
private Token parseSimpleToken(final Token tkn, int c) throws IOException {
|
||||||
// Faster to use while(true)+break than while(tkn.type == INVALID)
|
// Faster to use while(true)+break than while(tkn.type == INVALID)
|
||||||
while (true) {
|
while (true) {
|
||||||
if (readEndOfLine(c)) {
|
if (readEndOfLine(c)) {
|
||||||
@ -176,7 +176,7 @@ final class CSVLexer extends Lexer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An encapsulated token lexer
|
* Parses an encapsulated token.
|
||||||
* <p/>
|
* <p/>
|
||||||
* Encapsulated tokens are surrounded by the given encapsulating-string. The encapsulator itself might be included
|
* Encapsulated tokens are surrounded by the given encapsulating-string. The encapsulator itself might be included
|
||||||
* in the token using a doubling syntax (as "", '') or using escaping (as in \", \'). Whitespaces before and after
|
* in the token using a doubling syntax (as "", '') or using escaping (as in \", \'). Whitespaces before and after
|
||||||
@ -195,7 +195,7 @@ final class CSVLexer extends Lexer {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* on invalid state: EOF before closing encapsulator or invalid character before delimiter or EOL
|
* on invalid state: EOF before closing encapsulator or invalid character before delimiter or EOL
|
||||||
*/
|
*/
|
||||||
private Token encapsulatedTokenLexer(final Token tkn) throws IOException {
|
private Token parseEncapsulatedToken(final Token tkn) throws IOException {
|
||||||
// save current line number in case needed for IOE
|
// save current line number in case needed for IOE
|
||||||
final long startLineNumber = getLineNumber();
|
final long startLineNumber = getLineNumber();
|
||||||
int c;
|
int c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user