com.avaje.ebean.validation.factory
Class EmailValidation

java.lang.Object
  extended by com.avaje.ebean.validation.factory.EmailValidation
All Implemented Interfaces:
Serializable

public class EmailValidation
extends Object

    
implements Serializable

    

An email address represents the textual string of an RFC 2822 email address and other corresponding information of interest.

If you use this code, please keep the author information in tact and reference my site at leshazlewood.com. Thanks!

Rob Bygrave: I have renamed and modified this class slightly.

Author:
Les Hazlewood
See Also:
Serialized Form

Constructor Summary
EmailValidation(String pattern)
           
 
Method Summary
static EmailValidation create(boolean allowDomainLiterals, boolean allowQuotedIdentifiers)
          Create a Email address validator based on whether you wish to allow domain literals or quoted identifiers.
 boolean isValid(String email)
          Utility method that checks to see if the specified string is a valid email address according to the RFC 2822 specification.
static boolean isValidEmail(String email)
          Validation of email using the default validator.
static void main(String[] args)
          Test method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailValidation

public EmailValidation(String pattern)
Method Detail

create

public static EmailValidation create(boolean allowDomainLiterals,
                                     boolean allowQuotedIdentifiers)
Create a Email address validator based on whether you wish to allow domain literals or quoted identifiers.


isValid

public boolean isValid(String email)
Utility method that checks to see if the specified string is a valid email address according to the RFC 2822 specification.

Parameters:
email - the email address string to test for validity.
Returns:
true if the given text valid according to RFC 2822, false otherwise.

isValidEmail

public static boolean isValidEmail(String email)
Validation of email using the default validator.


main

public static void main(String[] args)
Test method.



Copyright © 2010. All Rights Reserved.