Package org.lobobrowser.html
Class FormInput
- java.lang.Object
-
- org.lobobrowser.html.FormInput
-
public class FormInput extends java.lang.Object
TheFormInput
class contains the state of an HTML form input item.
-
-
Field Summary
Fields Modifier and Type Field Description static FormInput[]
EMPTY_ARRAY
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getCharset()
Deprecated.The method is implemented only to provide some backward compatibility.java.io.File
getFileValue()
Gets the file value of the form input.java.io.InputStream
getInputStream()
Deprecated.Call eithergetTextValue()
orgetFileValue()
instead.java.lang.String
getName()
Gets the name of the input.java.lang.String
getTextValue()
Gets the text value of the form input.boolean
isFile()
Returns true if the form input holds a file value.boolean
isText()
Returns true if the form input holds a text value.java.lang.String
toString()
Shows a string representation of theFormInput
that may be useful in debugging.
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final FormInput[] EMPTY_ARRAY
-
-
Constructor Detail
-
FormInput
public FormInput(java.lang.String name, java.lang.String value)
Constructs aFormInput
with a text value.- Parameters:
name
- The name of the input.value
- The value of the input.
-
FormInput
public FormInput(java.lang.String name, java.io.File value)
Constructs aFormInput
with a file value.- Parameters:
name
- The name of the input.value
- The value of the input.
-
-
Method Detail
-
getName
public java.lang.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 java.lang.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:
isText()
-
getFileValue
public java.io.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:
isFile()
-
getCharset
public java.lang.String getCharset()
Deprecated.The method is implemented only to provide some backward compatibility.Always returns UTF-8.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Deprecated.Call eithergetTextValue()
orgetFileValue()
instead.Gets data as an input stream. The caller is responsible for closing the stream.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
Shows a string representation of theFormInput
that may be useful in debugging.- Overrides:
toString
in classjava.lang.Object
- See Also:
getTextValue()
-
-