public class RegexpValidator extends Object implements FieldValidator
<bean id="passwordValidator"
class="no.g9.client.core.validator.RegexpValidator">
<property name="patterns" value=".{6,}" />
</bean>
This bean supports the following properties:
| Constructor and Description |
|---|
RegexpValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
setFailMessageArgs(Object[] messageArgs)
Sets message text to return on failed validations.
|
void |
setFailMessageNumber(String messageID)
Sets message number to return on failed validations.
|
void |
setPattern(String pattern)
Sets a single pattern to validate against.
|
void |
setPatterns(String[] patterns)
Sets patterns to validate against.
|
ValidationResult |
validate(Object value,
ValidateContext context)
Validates a candidate value.
|
public void setPatterns(String[] patterns)
patterns - The regexp patterns to validate againstpublic void setPattern(String pattern)
pattern - The regexp pattern to validate againstpublic void setFailMessageNumber(String messageID)
messageID - The message number to return on failed validationspublic void setFailMessageArgs(Object[] messageArgs)
messageArgs - The message text to return on failed validationspublic ValidationResult validate(Object value, ValidateContext context)
FieldValidatorvalidate in interface FieldValidatorvalue - The candidate value to validatecontext - Validation contextCopyright © 2006–2020 Esito AS. All rights reserved.