Class EmailValidator

java.lang.Object
io.goobi.viewer.faces.validators.EmailValidator
All Implemented Interfaces:
Validator<String>, EventListener

public class EmailValidator extends Object implements Validator<String>
Syntax validator for e-mail addresses.
  • Constructor Details

    • EmailValidator

      public EmailValidator()
  • Method Details

    • validate

      public void validate(FacesContext context, UIComponent component, String value) throws ValidatorException
      Specified by:
      validate in interface Validator<String>
      Throws:
      ValidatorException
    • validateEmailAddress

      public static boolean validateEmailAddress(String email, boolean allowEmptyString)
      validateEmailAddress.
      Parameters:
      email - e-mail address string to validate against the RFC pattern
      allowEmptyString - use `true` if an empty email address is allowed
      Returns:
      true if the given email address is syntactically valid (or empty and allowed), false otherwise