/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: EmailValidator.java,v 1.2 2008/06/25 05:44:04 qcheng Exp $
*
*/
/**
* The class <code>EmailValidator</code> is used to check if the Email address
* is syntactically correct according to valid format defined in RFC 822. Email
* address must contain an @ symbol as well as syntactically correct username
* and domain information e.g. name@domain.com
*/
/**
* Default Constructor.
*/
public EmailValidator() {
}
/**
* Validates a set of email address.
*
* @param values
* the set of string email address to validate
* @return true if all of the email addresses are valid; false otherwise
*/
return false;
}
}
return true;
}
/**
* Validates an email address.
*
* @param value
* an email address
* @return true if the email address is valid; false otherwise
*/
if (index == -1) {
return false;
}
return true;
} else {
return false;
}
}
return false;
}
while (tok.hasMoreTokens()) {
return false;
}
}
return true;
}
for (int i = 0; i < length; i++) {
// The character can be any ASCII character except:
// a) ASCII control character and DEL
// b) space
// c) RFC 822 specials
return false;
}
}
return true;
}
return false;
}
while (tok.hasMoreTokens()) {
return false;
}
}
return true;
}
// subdomain can not start or end with a hyphen
return false;
}
// subdomain or "label" can not be longer than 63 chars
if (length > 63) {
return false;
}
for (int i = 0; i < length; i++) {
{
return false;
}
}
return true;
}
static {
// RFC 822 special characters
}
}