commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1298013 - in /commons/sandbox/csv/trunk/src: main/java/org/apache/commons/csv/CSVFormat.java test/java/org/apache/commons/csv/CSVFormatTest.java
Date Wed, 07 Mar 2012 16:32:36 GMT
Author: ebourg
Date: Wed Mar  7 16:32:36 2012
New Revision: 1298013

URL: http://svn.apache.org/viewvc?rev=1298013&view=rev
Log:
Added a mutator to CSVFormat to change the trimming behavior at both ends

Modified:
    commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
    commons/sandbox/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java

Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?rev=1298013&r1=1298012&r2=1298013&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java (original)
+++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Wed Mar
 7 16:32:36 2012
@@ -198,6 +198,13 @@ public class CSVFormat implements Clonea
         return format;
     }
 
+    public CSVFormat withSurroundingSpacesIgnored(boolean surroundingSpacesIgnored) {
+        CSVFormat format = clone();
+        format.leadingSpacesIgnored = surroundingSpacesIgnored;
+        format.trailingSpacesIgnored = surroundingSpacesIgnored;
+        return format;
+    }
+    
     public boolean isUnicodeEscapesInterpreted() {
         return unicodeEscapesInterpreted;
     }

Modified: commons/sandbox/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java?rev=1298013&r1=1298012&r2=1298013&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java (original)
+++ commons/sandbox/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java Wed
Mar  7 16:32:36 2012
@@ -57,6 +57,8 @@ public class CSVFormatTest extends TestC
         
         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());
     }



Mime
View raw message