public class RegexFieldValidator
extends com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
true
.true
.<validators> <!-- Plain Validator Syntax --> <validator type="regex"> <param name="fieldName">myStrangePostcode</param> <param name="expression"><![CDATA[([aAbBcCdD][123][eEfFgG][456])]]<>/param> </validator> <!-- Field Validator Syntax --> <field name="myStrangePostcode"> <field-validator type="regex"> <param name="expression"><![CDATA[([aAbBcCdD][123][eEfFgG][456])]]></param> </field-validator> </field> </validators>
Constructor and Description |
---|
RegexFieldValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getExpression() |
boolean |
isCaseSensitive() |
boolean |
isTrimed() |
void |
setCaseSensitive(boolean caseSensitive)
Sets whether the expression should be matched against in
a case-sensitive way.
|
void |
setExpression(String expression)
Sets the regular expression to be matched.
|
void |
setTrim(boolean trim)
Sets whether the expression should be trimed before matching.
|
void |
validate(Object object) |
getFieldName, getValidatorType, setFieldName, setValidatorType
addActionError, addFieldError, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setValidatorContext, setValueStack
public void validate(Object object) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationException
public String getExpression()
public void setExpression(String expression)
public boolean isCaseSensitive()
true
.public void setCaseSensitive(boolean caseSensitive)
true
.public boolean isTrimed()
true
.public void setTrim(boolean trim)
true
.Copyright © 2010–2015 Ifremer. All rights reserved.