org.lobobrowser.html

Class FormInput


public class FormInput
extends java.lang.Object

The FormInput class contains the state of an HTML form input item.

Field Summary

static FormInput[]
EMPTY_ARRAY

Constructor Summary

FormInput(String name, String value)
Constructs a FormInput with a text value.
FormInput(String name, java.io.File value)
Constructs a FormInput with a file value.

Method Summary

String
getCharset()
Deprecated. The method is implemented only to provide some backward compatibility.
java.io.File
getFileValue()
java.io.InputStream
getInputStream()
Deprecated. Call either getTextValue() or getFileValue() instead.
String
getName()
Gets the name of the input.
String
getTextValue()
boolean
isFile()
boolean
isText()
String
toString()
Shows a string representation of the FormInput that may be useful in debugging.

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,
                 java.io.File value)
Constructs a FormInput with a file value.
Parameters:
name - The name of the input.
value - The value of the input.

Method Details

getCharset

public String getCharset()

Deprecated. The method is implemented only to provide some backward compatibility.

Always returns UTF-8.

getFileValue

public java.io.File getFileValue()

getInputStream

public java.io.InputStream getInputStream()
            throws java.io.IOException

Deprecated. Call either getTextValue() or getFileValue() instead.

Gets data as an input stream. The caller is responsible for closing the stream.

getName

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

getTextValue

public String getTextValue()

isFile

public boolean isFile()

isText

public boolean isText()

toString

public String toString()
Shows a string representation of the FormInput that may be useful in debugging.