Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2.validator.validators
Class EmailValidator

    java.lang.Object
      com.opensymphony.xwork2.validator.validators.ValidatorSupport
          com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
              com.opensymphony.xwork2.validator.validators.RegexFieldValidator
                  com.opensymphony.xwork2.validator.validators.EmailValidator

All Implemented Interfaces:
  FieldValidator, ShortCircuitableValidator, Validator

    public class EmailValidator

extends RegexFieldValidator

EmailValidator checks that a given String field, if not empty, is a valid email address.

The regular expression used to validate that the string is an email address is:

     \\b(^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@([A-Za-z0-9-])+((\\.com)|(\\.net)|(\\.org)|(\\.info)|(\\.edu)|(\\.mil)|(\\.gov)|(\\.biz)|(\\.ws)|(\\.us)|(\\.tv)|(\\.cc)|(\\.aero)|(\\.arpa)|(\\.coop)|(\\.int)|(\\.jobs)|(\\.museum)|(\\.name)|(\\.pro)|(\\.travel)|(\\.nato)|(\\..{2,3})|(\\..{2,3}\\..{2,3}))$)\\b

- fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required

         <!-- Plain Validator Syntax -->
         <validators>
             <validator type="email">
                 <param name="fieldName">myEmail</param>
                 <message>Must provide a valid email</message>
             </validator>
         </validators>

         <!-- Field Validator Syntax -->
         <field name="myEmail">
            <field-validator type="email">
               <message>Must provide a valid email</message>
            </field-validator>
         </field>

Version:
  $Date: 2009-12-27 19:18:29 +0100 (Sun, 27 Dec 2009) $ $Id: EmailValidator.java 894090 2009-12-27 18:18:29Z martinc $
Author:
  jhouse, tm_jee

Field Summary
`static java.lang.String` | `emailAddressPattern`

Fields inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
`defaultMessage, log, messageKey`

Constructor Summary
`EmailValidator()`

Method Summary

Methods inherited from class com.opensymphony.xwork2.validator.validators.RegexFieldValidator
`getExpression, isCaseSensitive, isTrimed, setCaseSensitive, setExpression, setTrim, validate`

Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
`getFieldName, getValidatorType, setFieldName, setValidatorType`

Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
`addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContext, setValueStack`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.opensymphony.xwork2.validator.Validator
`getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStack`

Field Detail

### emailAddressPattern

    public static final java.lang.String emailAddressPattern

See Also:
  Constant Field Values

Constructor Detail

### EmailValidator

    public EmailValidator()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.