Dashboard > WebWork > ... > J2SE 5 Support > StringRegexValidator Annotation
  WebWork Log In View a printable version of the current page.  
  StringRegexValidator Annotation
Added by Rainer Hermanns, last edited by Rainer Hermanns on Apr 13, 2007  (view change)
Labels: 
(None)

StringRegexValidator Annotation

StringRegexValidator checks that a given String field, if not empty, matches the configured regular expression.

Usage

The annotation must be applied at method level.

Parameters

Parameter Required Default Notes
message yes   field error message
key no   i18n key from language specific properties file.
fieldName no    
shortCircuit no false If this validator should be used as shortCircuit.
type yes ValidatorType.FIELD Enum value from ValidatorType. Either FIELD or SIMPLE can be used here.
regex yes "." String property. The Regular Expression for which to check a match.
caseSensitive no true Whether the matching of alpha characters in the expression should be done case-sensitively.

Examples

@StringRegexValidator(message = "Default message", key = "i18n.key", shortCircuit = true, regex = "a regular expression", caseSensitive = true)

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators