FormControlOutputStyle
Date: 2016-12-04

net.htmlparser.jericho

## Enum FormControlOutputStyle

- java.lang.Object
- - java.lang.Enum<FormControlOutputStyle>
  - - net.htmlparser.jericho.FormControlOutputStyle

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FormControlOutputStyle>

      public enum FormControlOutputStyle
      extends java.lang.Enum<FormControlOutputStyle>

  An enumerated type representing the three major output styles of a form control's output element.

  A form control's output style is set using the `FormControl.setOutputStyle(FormControlOutputStyle)` method.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FormControlOutputStyle.ConfigDisplayValue` Contains static properties that configure the `DISPLAY_VALUE` form control output style.

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `DISPLAY_VALUE` The normal output element is replaced with a simple representation of the form control's submission value(s).
    `NORMAL` Normal display of the output element.
    `REMOVE` Remove the output element from the output document completely.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDebugInfo()` Returns a string representation of this object useful for debugging purposes.
    `static FormControlOutputStyle` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static FormControlOutputStyle[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### NORMAL

          public static final FormControlOutputStyle NORMAL

      Normal display of the output element.

      This is the default display style.

    - #### REMOVE

          public static final FormControlOutputStyle REMOVE

      Remove the output element from the output document completely.

    - #### DISPLAY_VALUE

          public static final FormControlOutputStyle DISPLAY_VALUE

      The normal output element is replaced with a simple representation of the form control's submission value(s).

      The implementation of this functionality is highly subjective, but provides a more aesthetic way of displaying a read-only version of a form without having to resort to using disabled controls.

      The representation is dependent on the form control type, and can be configured using the static properties of the `ConfigDisplayValue` nested class.

      Unless specified otherwise below, the normal output element is replaced with a display value element having the name specified in the static `ConfigDisplayValue.ElementName` property (`div` by default). The attributes specified in the static `ConfigDisplayValue.AttributeNames` list (`id`, `class` and `style` by default) are copied from the normal output element into the display value element.

      Details of the content of the display value element or other representation of the control value are as follows:

      `TEXT`, `FILE`
        The content of the display value element is the re-encoded value of the normal output element's `value` attribute.
      `TEXTAREA`
        The content of the display value element is the content of the `TEXTAREA` element re-encoded with white space formatting.
      `CHECKBOX`, `RADIO`
        The normal output element is replaced with the un-encoded content specified in the `ConfigDisplayValue.CheckedHTML` or `ConfigDisplayValue.UncheckedHTML` static property, depending on whether the normal output element contains a `checked` attribute. If the relevant static property has a value of `null` (the default), the output element is simply a disabled version of the form control. Attempting to determine which labels might apply to which checkbox or radio button, allowing only the selected controls to be displayed, would require a very complex and inexact algorithm, so is best left to the developer to implement if required.
      `SELECT_SINGLE`, `SELECT_MULTIPLE`
        The content of the display value element is the re-encoded label of the currently selected option. In the case of a `SELECT_MULTIPLE` control, all labels of selected options are listed, separated by the text specified in the static `ConfigDisplayValue.MultipleValueSeparator` property ("`,` " by default).
      `PASSWORD`
        The content of the display value element is the encoded character specified in the `ConfigDisplayValue.PasswordChar` static property ('`*`' by default), repeated n times, where n is the number of characters in the control's submission value.
      `HIDDEN`
        The output element is removed completely.
      `BUTTON`, `SUBMIT`, `IMAGE`
        The output element is a disabled version of the original form control.

      If the submission value of the control is `null` or an empty string, the display value element is given the un-encoded content specified in the `ConfigDisplayValue.EmptyHTML` static property.

  - ### Method Detail

    - #### values

          public static FormControlOutputStyle[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (FormControlOutputStyle c : FormControlOutputStyle.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static FormControlOutputStyle valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getDebugInfo

          public java.lang.String getDebugInfo()

      Returns a string representation of this object useful for debugging purposes.

      This is equivalent to `Enum.toString()`.

      Returns:
        a string representation of this object useful for debugging purposes.