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: 2006-07-10 02:30:29 +0200 (Mo, 10 Jul 2006) $ $Id: EmailValidator.java 1063 2006-07-10 00:30:29Z mrdon $
Author:
  jhouse, tm_jee

Field Summary
`static 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, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setParse, setShortCircuit, setValidatorContext`

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, getValidatorContext, setDefaultMessage, setMessageKey, setValidatorContext`

Field Detail

### emailAddressPattern

    public static final 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-2007 Apache Software Foundation. All Rights Reserved.