Class FormInput

java.lang.Object
org.lobobrowser.html.FormInput

public class FormInput extends Object
The FormInput class contains the state of an HTML form input item.
  • Field Details

    • EMPTY_ARRAY

      public static final FormInput[] EMPTY_ARRAY
  • Constructor Details

    • FormInput

      public FormInput(String name, String value)
      Constructs a FormInput with a text value.
      Parameters:
      name - The name of the input.
      value - The value of the input.
    • FormInput

      public FormInput(String name, File value)
      Constructs a FormInput with a file value.
      Parameters:
      name - The name of the input.
      value - The value of the input.
  • Method Details

    • getName

      public String getName()
      Gets the name of the input.
    • isText

      public boolean isText()
      Returns true if the form input holds a text value.
    • isFile

      public boolean isFile()
      Returns true if the form input holds a file value.
    • getTextValue

      public String getTextValue()
      Gets the text value of the form input. If the form input does not hold a text value, this method should not be called.
      See Also:
    • getFileValue

      public File getFileValue()
      Gets the file value of the form input. If the form input does not hold a file value, this method should not be called.
      See Also:
    • getCharset

      public String getCharset()
      Deprecated.
      The method is implemented only to provide some backward compatibility.
      Always returns UTF-8.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Deprecated.
      Call either getTextValue() or getFileValue() instead.
      Gets data as an input stream. The caller is responsible for closing the stream.
      Throws:
      IOException
    • toString

      public String toString()
      Shows a string representation of the FormInput that may be useful in debugging.
      Overrides:
      toString in class Object
      See Also: