Added a mutator to CSVFormat to change the trimming behavior at both ends
git-svn-id: https://svn.apache.org/repos/asf/commons/sandbox/csv/trunk@1298013 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
00d0def695
commit
898b7f9629
|
@ -198,6 +198,13 @@ public class CSVFormat implements Cloneable, Serializable {
|
|||
return format;
|
||||
}
|
||||
|
||||
public CSVFormat withSurroundingSpacesIgnored(boolean surroundingSpacesIgnored) {
|
||||
CSVFormat format = clone();
|
||||
format.leadingSpacesIgnored = surroundingSpacesIgnored;
|
||||
format.trailingSpacesIgnored = surroundingSpacesIgnored;
|
||||
return format;
|
||||
}
|
||||
|
||||
public boolean isUnicodeEscapesInterpreted() {
|
||||
return unicodeEscapesInterpreted;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ public class CSVFormatTest extends TestCase {
|
|||
|
||||
assertEquals(false, format.withLeadingSpacesIgnored(false).isLeadingSpacesIgnored());
|
||||
assertEquals(false, format.withTrailingSpacesIgnored(false).isTrailingSpacesIgnored());
|
||||
assertEquals(false, format.withSurroundingSpacesIgnored(false).isLeadingSpacesIgnored());
|
||||
assertEquals(false, format.withSurroundingSpacesIgnored(false).isTrailingSpacesIgnored());
|
||||
assertEquals(false, format.withEmptyLinesIgnored(false).isEmptyLinesIgnored());
|
||||
assertEquals(false, format.withUnicodeEscapesInterpreted(false).isUnicodeEscapesInterpreted());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue