| java.lang.Object com.rimfaxe.webserver.forms.URLDecoder
URLDecoder | public class URLDecoder (Code) | | Form data decoder.
This class takes an InputStream and decodes it in compliance to the
application/x-www-form-urlencoded MIME type.
|
Constructor Summary | |
public | URLDecoder(Reader in, boolean overide) Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). | public | URLDecoder(Reader in) Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). | public | URLDecoder(InputStream in, boolean overide) Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). | public | URLDecoder(InputStream in) Create an URLDecoder for the given stream. |
Method Summary | |
protected void | addVariable(String var, String val) Define a new variable in this data set. | public String[] | getMultipleValues(String name) Get the values of the variable, as an array.
Use this method when you have turned off the overide flag
in the constructor of this object. | public String | getValue(String name) Get the value of a variable.
If you have allowed the decoder to accumulate multiple values for the
same variable, this method casts of the value to a String may fail
at runtime.
Parameters: name - The name of the variable whose value is to be fetched. | public Enumeration | keys() Get an enumeration of the variable names. | public Hashtable | parse() Parse our input stream following the
application/x-www-form-urlencoded specification. |
URLDecoder | public URLDecoder(Reader in, boolean overide)(Code) | | Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). Otherwise, the last assignment will overide any previous assignment. |
URLDecoder | public URLDecoder(Reader in)(Code) | | Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). Otherwise, the last assignment will overide any previous assignment. |
URLDecoder | public URLDecoder(InputStream in, boolean overide)(Code) | | Create an URLDecoder for the given stream.
Parameters: in - The input stream to be parsed. Parameters: list - Tells how to handle multiple settings of the same variable.When false, mutiple settings to the same variablewill accumulate the value into an array, returned by getValue(). Otherwise, the last assignment will overide any previous assignment. |
URLDecoder | public URLDecoder(InputStream in)(Code) | | Create an URLDecoder for the given stream.
Default constructor, which will keep track only of the last setting
of the same variable (if ever it gets assigned multiply).
Parameters: in - The input stream to be parsed. |
addVariable | protected void addVariable(String var, String val)(Code) | | Define a new variable in this data set.
Parameters: name - The name of the variable. Parameters: value - Its value. |
getMultipleValues | public String[] getMultipleValues(String name)(Code) | | Get the values of the variable, as an array.
Use this method when you have turned off the overide flag
in the constructor of this object. This will always return either an
array of Strings or null.
I use this in the PICS label bureau, and I pretty sure this is not a
good reason to have it here.
Parameters: name - The name of the variable to look for. An String[] having one entry per variable's value, or null if none was found. |
getValue | public String getValue(String name)(Code) | | Get the value of a variable.
If you have allowed the decoder to accumulate multiple values for the
same variable, this method casts of the value to a String may fail
at runtime.
Parameters: name - The name of the variable whose value is to be fetched. Its values, which is always provided as a String, or null. |
keys | public Enumeration keys()(Code) | | Get an enumeration of the variable names.
An enumeration continaing one element per key. |
|
|