Moves parse(String, Class) to parent class to allow use it in all subclasess

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428281 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2013-01-03 11:13:36 +00:00
parent 159829bd5b
commit 673873c0c6
2 changed files with 7 additions and 8 deletions
@@ -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 FieldValidatorSupport {
}
}
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>.
@@ -180,6 +180,13 @@ public abstract class ValidatorSupport implements Validator, ShortCircuitableVal
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.