You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2013/01/03 12:13:36 UTC
svn commit: r1428281 - in
/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators:
RegexFieldValidator.java ValidatorSupport.java
Author: lukaszlenart
Date: Thu Jan 3 11:13:36 2013
New Revision: 1428281
URL: http://svn.apache.org/viewvc?rev=1428281&view=rev
Log:
Moves parse(String, Class) to parent class to allow use it in all subclasess
Modified:
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java?rev=1428281&r1=1428280&r2=1428281&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RegexFieldValidator.java Thu Jan 3 11:13:36 2013
@@ -16,7 +16,6 @@
package com.opensymphony.xwork2.validator.validators;
-import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.validator.ValidationException;
import java.util.regex.Matcher;
@@ -124,13 +123,6 @@ public class RegexFieldValidator extends
}
}
- protected Object parse(String expression, Class type) {
- if (expression == null) {
- return null;
- }
- return TextParseUtil.translateVariables('$', expression, stack, type);
- }
-
/**
* @return Returns whether the expression should be matched against in
* a case-sensitive way. Default is <code>true</code>.
Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java?rev=1428281&r1=1428280&r2=1428281&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java Thu Jan 3 11:13:36 2013
@@ -180,6 +180,13 @@ public abstract class ValidatorSupport i
return expression;
}
+ protected Object parse(String expression, Class type) {
+ if (expression == null) {
+ return null;
+ }
+ return TextParseUtil.translateVariables('$', expression, stack, type);
+ }
+
/**
* Return the field value named <code>name</code> from <code>object</code>,
* <code>object</code> should have the appropriate getter/setter.