Enum Class FormEncoding

java.lang.Object
java.lang.Enum<FormEncoding>
com.oorian.html.elements.consts.FormEncoding
All Implemented Interfaces:
Serializable, Comparable<FormEncoding>, Constable

public enum FormEncoding extends Enum<FormEncoding>
Enumeration defining the MIME encoding types for form data submission. This enum provides type-safe constants for the form element's "enctype" attribute, which specifies how form data should be encoded before being sent to the server.
Since:
1.0
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • APPLICATION_X_WWW_FORM_URL_ENCODED

      public static final FormEncoding APPLICATION_X_WWW_FORM_URL_ENCODED
      URL-encoded form data (default encoding type). All characters are encoded before being sent (spaces become '+', special characters become '%HH'). This is the default encoding type for forms when not specified.
    • MULTIPART_FORM_DATA

      public static final FormEncoding MULTIPART_FORM_DATA
      Multipart form data encoding. Required when uploading files through a form. Data is sent as a multipart message with each form field as a separate part with its own content type.
    • TEXT_PLAIN

      public static final FormEncoding TEXT_PLAIN
      Plain text encoding. Spaces are converted to '+' symbols but no special characters are encoded. Primarily used for email forms and debugging purposes.
  • Method Details

    • values

      public static FormEncoding[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FormEncoding valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Gets the MIME type string for this encoding type.
      Returns:
      the MIME type value used in the HTML enctype attribute.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<FormEncoding>