/*
 * Created on 02/02/2007
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package agilpizza.servlet;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ValidacaoUtil {

	public static boolean isVazio(String valor) {
		return valor == null || valor.trim().equals("");
	}

	public static boolean isValidEmail(String email) {

		if (isVazio(email)) return false;
		
		// Set the email pattern string
		Pattern p = Pattern.compile(".+@.+\\.[a-z]+");

		// Match the given string with the pattern
		Matcher m = p.matcher(email);

		return m.matches();

	}

}
