You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2009/11/27 21:29:39 UTC

svn commit: r884989 - /incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java

Author: ajaquith
Date: Fri Nov 27 20:29:38 2009
New Revision: 884989

URL: http://svn.apache.org/viewvc?rev=884989&view=rev
Log:
LineDelimitedTypeConverter was changed to handle linefeeds and comma-delimited text strings equally. So far, only EditGroup.jsp uses this feature.

Modified:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java?rev=884989&r1=884988&r2=884989&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/LineDelimitedTypeConverter.java Fri Nov 27 20:29:38 2009
@@ -24,8 +24,11 @@
 import net.sourceforge.stripes.validation.OneToManyTypeConverter;
 
 /**
- * Overrides {@link net.sourceforge.stripes.validation.OneToManyTypeConverter} so
- * that multiple items parsed by the converter use carriage return delimiters, instead of spaces and commas.
+ * More flexible version of
+ * {@link net.sourceforge.stripes.validation.OneToManyTypeConverter} that allows
+ * converted strings to be delimited by carriage return, carriage return +
+ * linefeed, or commas. Leading and trailing whitespace after the CR or CR/LF is
+ * trimmed.
  */
 public class LineDelimitedTypeConverter extends OneToManyTypeConverter
 {
@@ -33,7 +36,6 @@
     @Override
     protected String getSplitRegex()
     {
-        return "\n";
+        return "\\s*((\\r*?\\n)|,+)+?\\s*";
     }
-    
 }