We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
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:
Direct Known Subclasses:
- extends AbstractStringValidator
public class RegexpValidator
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.18
Author:
Vaadin Ltd.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.Validator |
---|
Validator.EmptyValueException, Validator.InvalidValueException |
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 com.vaadin.data.validator.AbstractStringValidator |
---|
isValid |
Methods inherited from class com.vaadin.data.validator.AbstractValidator |
---|
getErrorMessage, setErrorMessage, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
RegexpValidator
public RegexpValidator(String regexp,
String errorMessage)
- Parameters:
regexp
- a Java regular expressionerrorMessage
- the message to display in case the value does not validate.
Creates a validator for checking that the regular expression matches the complete string to validate.
RegexpValidator
public RegexpValidator(String regexp,
boolean complete,
String errorMessage)
- 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.
Creates a validator for checking that the regular expression matches the string to validate.
Method Detail |
---|
isValidString
protected boolean isValidString(String value)
- Specified by:
isValidString
in classAbstractStringValidator
- Parameters:
value
- String to check. Can never be null.- Returns:
- true if the string is valid, false otherwise
Description copied from class: AbstractStringValidator
Checks if the given string is valid.