Module org.htmlunit

Class HtmlEmailInput

All Implemented Interfaces:
Serializable, Cloneable, DisabledElement, SelectableTextInput, LabelableElement, SubmittableElement, ValidatableHtmlElement, Element, Node

public class HtmlEmailInput extends HtmlSelectableTextInput implements LabelableElement
Wrapper for the HTML element "input" where type is "email".
Author:
Ahmed Ashour, Ronald Brill, Frank Danek, Anton Demydenko, Michael Lueck
See Also:
  • Method Details

    • setDefaultChecked

      public void setDefaultChecked(boolean defaultChecked)
      Sets the default checked state to use when this element gets reset, if applicable. The default implementation is empty; only checkboxes and radio buttons really care what the default checked value is.
      Specified by:
      setDefaultChecked in interface SubmittableElement
      Parameters:
      defaultChecked - the default checked state to use when this element gets reset, if applicable
      See Also:
    • getValue

      public String getValue()
      Returns the value.
      Overrides:
      getValue in class HtmlInput
      Returns:
      the value
    • isPatternSupported

      protected boolean isPatternSupported()
      Returns if the input element supports pattern validation. Refer to the HTML 5 documentation for details.
      Overrides:
      isPatternSupported in class HtmlInput
      Returns:
      if the input element supports pattern validation
    • isBlankPatternValidated

      protected boolean isBlankPatternValidated()
      Returns if the element executes pattern validation on blank strings.
      Overrides:
      isBlankPatternValidated in class HtmlInput
      Returns:
      if the element executes pattern validation on blank strings
    • isMinMaxLengthSupported

      protected boolean isMinMaxLengthSupported()
      Returns if the input element supports maxlength minlength validation. Refer to the HTML 5 documentation for details.
      Overrides:
      isMinMaxLengthSupported in class HtmlInput
      Returns:
      if the input element supports pattern validation
    • hasTypeMismatchValidityState

      public boolean hasTypeMismatchValidityState()
      Returns whether the element's value has a type mismatch. Per spec, a non-empty value must match the (deliberately simplified, RFC-5322-approximating) email pattern above. An empty value is never a type mismatch on its own -- that's valueMissing's concern, if 'required' is set.
      Specified by:
      hasTypeMismatchValidityState in interface ValidatableHtmlElement
      Returns:
      true if the value is not in the required syntax (for example, for email or url); if true, the element matches the :invalid CSS pseudo-class
    • getTypeMismatchMessage

      public String getTypeMismatchMessage()
      Returns the message describing a type mismatch (the element's value is not in the syntax required by its type, e.g. email or url). Generic, uniform wording -- override in a concrete class that can produce a type-specific message.
      Specified by:
      getTypeMismatchMessage in interface ValidatableHtmlElement
      Returns:
      the type mismatch message