|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acciente.commons.htmlform.Parser
public class Parser
This class implements a parser that parses the parameters (and data) submitted in an HTML form and populates a Map with the form data.
| Constructor Summary | |
|---|---|
Parser()
|
|
| Method Summary | |
|---|---|
static void |
addParameter2Form(Map oForm,
ParameterSpec oParameterSpec,
org.apache.commons.fileupload.FileItem oFileItem)
This method is not a typical entry point into the parser. |
static void |
addParameter2Form(Map oForm,
ParameterSpec oParameterSpec,
String sData,
boolean bURLEncoded)
This method is not a typical entry point into the parser. |
static Map |
parseForm(javax.servlet.http.HttpServletRequest oRequest,
int iStoreFileOnDiskThresholdInBytes,
File oUploadedFileStorageDir)
This method parses all the parameters contained in the http servlet request, in particular it parses and merges parameters from the sources listed below. |
static Map |
parseForm(Reader oInput,
boolean bURLEncoded)
This method parses a character stream containing an HTML form encoded using the application/x-www-form-urlencoded scheme. |
static ParameterSpec |
parseParameterSpec(Reader oReader)
This method is not typicaly used by applications. |
static ParameterSpec |
parseParameterSpec(Reader oReader,
String sDefaultType)
This method is not typicaly used by applications. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Parser()
| Method Detail |
|---|
public static Map parseForm(javax.servlet.http.HttpServletRequest oRequest,
int iStoreFileOnDiskThresholdInBytes,
File oUploadedFileStorageDir)
throws ParserException,
IOException,
org.apache.commons.fileupload.FileUploadException
oRequest - a http servlet request objectiStoreFileOnDiskThresholdInBytes - a file size in bytes above which the uploaded file will be stored on diskoUploadedFileStorageDir - a File object representing a path to which the uploaded files should be saved,
if null is specified a temporary directory is created in the java system temp directory path
ParserException - thrown if there is an error parsing the parameter data
IOException - thrown if there is an I/O error
org.apache.commons.fileupload.FileUploadException - thrown if there is an error processing the multi-part data
public static Map parseForm(Reader oInput,
boolean bURLEncoded)
throws ParserException,
IOException
oInput - the character stream containg the encoded HTML formbURLEncoded - if true the data value in the form are assumed to be URL encoded and the parser will
decoded the values
ParserException - if there was an error parsing the HTML form
IOException - if there was an error reading the input character stream
public static ParameterSpec parseParameterSpec(Reader oReader)
throws ParserException,
IOException
oReader - a character stream containing the parameter, this stream will read until either
the end of the stream is reached or until a TOKEN_EQUALS is encountered
ParserException - if there was an error parsing the HTML form
IOException - if there was an error reading the input character stream
public static ParameterSpec parseParameterSpec(Reader oReader,
String sDefaultType)
throws ParserException,
IOException
oReader - a character stream containing the parameter, this stream will read until either
the end of the stream is reached or until a TOKEN_EQUALS is encounteredsDefaultType - specifies the parameter type that the parser should assume in the absence of a explicit
parameter type in the paramater spec's string definition (read via the passed in oReader), the value must
be null or one of the following values: string, int, float, boolean, file (the most current set is defined in
com.acciente.commons.htmlform.Symbols). If null is specified the string type is assumed
ParserException - if there was an error parsing the HTML form
IOException - if there was an error reading the input character stream
public static void addParameter2Form(Map oForm,
ParameterSpec oParameterSpec,
String sData,
boolean bURLEncoded)
throws ParserException,
UnsupportedEncodingException
oForm - a Map into which the data should be storedoParameterSpec - the parameter spec according to which the data value will be stored in the mapsData - the data value to be stored in the mapbURLEncoded - true if the data value is in URL encoded form and needs to be decoded before storing into the map
ParserException - thrown if the parameter spec will cause an overwrite of an existing value or if the
parameter spec is in an unexpected format
UnsupportedEncodingException - if there was an exception thrown during any URL decoding that was attempted
public static void addParameter2Form(Map oForm,
ParameterSpec oParameterSpec,
org.apache.commons.fileupload.FileItem oFileItem)
throws ParserException,
UnsupportedEncodingException
oForm - a Map into which the data should be storedoParameterSpec - the parameter spec according to which the data value will be stored in the mapoFileItem - an uploaded file containing the data to be stored in the map
ParserException - thrown if the parameter spec will cause an overwrite of an existing value or if the
parameter spec is in an unexpected format
UnsupportedEncodingException - if there was an exception thrown during any URL decoding that was attempted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||