com.vaadin.data.validator
Class RegexpValidator
java.lang.Object
com.vaadin.data.validator.AbstractValidator
com.vaadin.data.validator.AbstractStringValidator
com.vaadin.data.validator.RegexpValidator
- All Implemented Interfaces:
- Validator, Serializable
- Direct Known Subclasses:
- EmailValidator
public class RegexpValidator
- extends AbstractStringValidator
String validator comparing the string against a Java regular expression. Both
complete matches and substring matches are supported.
For the Java regular expression syntax, see
java.util.regex.Pattern#sum
See AbstractStringValidator
for more
information.
- Since:
- 5.4
- Version:
- 6.8.5
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
Constructor Summary |
RegexpValidator(String regexp,
boolean complete,
String errorMessage)
Creates a validator for checking that the regular expression matches the
string to validate. |
RegexpValidator(String regexp,
String errorMessage)
Creates a validator for checking that the regular expression matches the
complete string to validate. |
Method Summary |
protected boolean |
isValidString(String value)
Checks if the given string is valid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexpValidator
public RegexpValidator(String regexp,
String errorMessage)
- Creates a validator for checking that the regular expression matches the
complete string to validate.
- Parameters:
regexp
- a Java regular expressionerrorMessage
- the message to display in case the value does not validate.
RegexpValidator
public RegexpValidator(String regexp,
boolean complete,
String errorMessage)
- Creates a validator for checking that the regular expression matches the
string to validate.
- Parameters:
regexp
- a Java regular expressioncomplete
- true to use check for a complete match, false to look for a
matching substringerrorMessage
- the message to display in case the value does not validate.
isValidString
protected boolean isValidString(String value)
- Description copied from class:
AbstractStringValidator
- Checks if the given string is valid.
- Specified by:
isValidString
in class AbstractStringValidator
- Parameters:
value
- String to check. Can never be null.
- Returns:
- true if the string is valid, false otherwise
Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.