Commits

Anonymous committed 68368cc

XW-623:
Change MULTI_TEXTVALUE_SPARATOR into a property configurable by injection of constant named xwork.validatorfileparser.multi_textvalue_separator

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1860e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 976c650

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork2/validator/DefaultValidatorFileParser.java

 
     private static Logger LOG = LoggerFactory.getLogger(DefaultValidatorFileParser.class);
 
-    static final String MULTI_TEXTVALUE_SEPARATOR = " ";
+    static final String DEFAULT_MULTI_TEXTVALUE_SEPARATOR = " ";
+    static final String MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY = "xwork.validatorfileparser.multi_textvalue_separator";
+
     private ObjectFactory objectFactory;
+    private String multiTextvalueSeparator=DEFAULT_MULTI_TEXTVALUE_SEPARATOR;
+
+    @Inject(value=MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY, required = false)
+    public void setMultiTextvalueSeparator(String type) {
+        multiTextvalueSeparator = type;
+    }
+
+    public String getMultiTextvalueSeparator() {
+        return multiTextvalueSeparator;
+    }
 
     @Inject
     public void setObjectFactory(ObjectFactory fac) {
      * @see org.w3c.dom.EntityReference
      * @see org.w3c.dom.Comment
      */
-    public static String getTextValue(Element valueEle) {
+    public String getTextValue(Element valueEle) {
         StringBuilder value = new StringBuilder();
         NodeList nl = valueEle.getChildNodes();
         boolean firstCDataFound = false;
                 final String nodeValue = item.getNodeValue();
                 if (nodeValue != null) {
                     if (firstCDataFound) {
-                        value.append(MULTI_TEXTVALUE_SEPARATOR);
+                        value.append(getMultiTextvalueSeparator());
                     } else {
                         firstCDataFound = true;
                     }