mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-25 12:26:53 +00:00
Rename ivar to ignoreSurroundingSpaces to match CSVFormat.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397784 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
50e2719bb6
commit
3655efcedb
@ -90,7 +90,7 @@ class CSVLexer extends Lexer {
|
||||
// important: make sure a new char gets consumed in each iteration
|
||||
while (token.type == INVALID) {
|
||||
// ignore whitespaces at beginning of a token
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
while (isWhitespace(c) && !eol) {
|
||||
c = in.read();
|
||||
eol = isEndOfLine(c);
|
||||
@ -163,7 +163,7 @@ class CSVLexer extends Lexer {
|
||||
}
|
||||
}
|
||||
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
trimTrailingSpaces(tkn.content);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ abstract class Lexer {
|
||||
private final Character encapsulator;
|
||||
private final Character commmentStart;
|
||||
|
||||
final boolean surroundingSpacesIgnored;
|
||||
final boolean ignoreSurroundingSpaces;
|
||||
final boolean emptyLinesIgnored;
|
||||
|
||||
final CSVFormat format;
|
||||
@ -52,7 +52,7 @@ abstract class Lexer {
|
||||
this.escape = format.getEscape();
|
||||
this.encapsulator = format.getEncapsulator();
|
||||
this.commmentStart = format.getCommentStart();
|
||||
this.surroundingSpacesIgnored = format.getIgnoreSurroundingSpaces();
|
||||
this.ignoreSurroundingSpaces = format.getIgnoreSurroundingSpaces();
|
||||
this.emptyLinesIgnored = format.getIgnoreEmptyLines();
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ class CSVLexer1306663 extends Lexer {
|
||||
// important: make sure a new char gets consumed in each iteration
|
||||
while (tkn.type == INVALID) {
|
||||
// ignore whitespaces at beginning of a token
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
while (isWhitespace(c) && !eol) {
|
||||
c = in.read();
|
||||
eol = isEndOfLine(c);
|
||||
@ -161,7 +161,7 @@ class CSVLexer1306663 extends Lexer {
|
||||
}
|
||||
}
|
||||
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
trimTrailingSpaces(tkn.content);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ class CSVLexer1306667 extends Lexer {
|
||||
// important: make sure a new char gets consumed in each iteration
|
||||
while (tkn.type == INVALID) {
|
||||
// ignore whitespaces at beginning of a token
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
while (isWhitespace(c) && !eol) {
|
||||
c = in.read();
|
||||
eol = isEndOfLine(c);
|
||||
@ -161,7 +161,7 @@ class CSVLexer1306667 extends Lexer {
|
||||
}
|
||||
}
|
||||
|
||||
if (surroundingSpacesIgnored) {
|
||||
if (ignoreSurroundingSpaces) {
|
||||
trimTrailingSpaces(tkn.content);
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class CSVLexer3 extends Lexer {
|
||||
state = State.PLAIN;
|
||||
break;
|
||||
case WHITESPACE:
|
||||
if (!surroundingSpacesIgnored){
|
||||
if (!ignoreSurroundingSpaces){
|
||||
tkn.content.append((char) intch);
|
||||
state = State.PLAIN;
|
||||
}
|
||||
@ -155,7 +155,7 @@ class CSVLexer3 extends Lexer {
|
||||
state = State.ESCAPE_PLAIN;
|
||||
break;
|
||||
default:
|
||||
trimTrailingSpaces = surroundingSpacesIgnored; // we have a plain token
|
||||
trimTrailingSpaces = ignoreSurroundingSpaces; // we have a plain token
|
||||
tkn.content.append((char) intch);
|
||||
break;
|
||||
}
|
||||
@ -191,7 +191,7 @@ class CSVLexer3 extends Lexer {
|
||||
state = State.INQUOTE;
|
||||
break;
|
||||
case WHITESPACE: // trailing whitespace may be allowed
|
||||
if (!surroundingSpacesIgnored) {
|
||||
if (!ignoreSurroundingSpaces) {
|
||||
// error invalid char between token and next delimiter
|
||||
throw new IOException("(line " + getLineNumber() + ") invalid char between encapsulated token and delimiter");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user