public class ParameterParser extends Object
| Constructor and Description |
|---|
ParameterParser(javax.servlet.ServletRequest request)
Constructs a new ParameterParser to handle the parameters of the given
request.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanParameter(String name)
Gets the named parameter value as a boolean
|
boolean |
getBooleanParameter(String name,
boolean def)
Gets the named parameter value as a boolean, with a default.
|
boolean |
getBooleanSubParameter(String first,
String next,
boolean def)
Gets the booleanSubParameter attribute of the ParameterParser object
|
byte |
getByteParameter(String name)
Gets the named parameter value as a byte
|
byte |
getByteParameter(String name,
byte def)
Gets the named parameter value as a byte, with a default.
|
String |
getCcnParameter(String name)
getCcnParameter.
|
char |
getCharParameter(String name)
Gets the named parameter value as a char
|
char |
getCharParameter(String name,
char def)
Gets the named parameter value as a char, with a default.
|
String |
getClassNameParameter(String name)
Gets the classNameParameter attribute of the ParameterParser object
|
String |
getClassNameParameter(String name,
String def)
Gets the classNameParameter attribute of the ParameterParser object
|
String |
getDateParameter(String name)
getDateParameter.
|
String |
getDateParameter(String name,
String def)
getDateParameter.
|
double |
getDoubleParameter(String name)
Gets the named parameter value as a double
|
double |
getDoubleParameter(String name,
double def)
Gets the named parameter value as a double, with a default.
|
String |
getEMailParameter(String name)
getEMailParameter.
|
String |
getEMailParameter(String name,
String def)
getEMailParameter.
|
float |
getFloatParameter(String name)
Gets the named parameter value as a float
|
float |
getFloatParameter(String name,
float def)
Gets the named parameter value as a float, with a default.
|
int |
getIntParameter(String name)
Gets the named parameter value as a int
|
int |
getIntParameter(String name,
int def)
Gets the named parameter value as a int, with a default.
|
String |
getIPParameter(String name)
Gets the named parameter value as an IP String
|
String |
getIPParameter(String name,
String def)
Gets the named parameter value as an IP String, with a default.
|
long |
getLongParameter(String name)
Gets the named parameter value as a long
|
long |
getLongParameter(String name,
long def)
Gets the named parameter value as a long, with a default.
|
String[] |
getMissingParameters(String[] requestuired)
Determines which of the required parameters were missing from the
request.
|
Enumeration<String> |
getParameterNames()
Gets the parameterNames attribute of the ParameterParser object
|
String[] |
getParameterValues(String name)
Gets the parameterValues attribute of the ParameterParser object
|
String |
getPhoneParameter(String name)
getPhoneParameter.
|
String |
getPhoneParameter(String name,
String def)
getPhoneParameter.
|
String |
getRawParameter(String name)
Gets the rawParameter attribute of the ParameterParser object
|
String |
getRawParameter(String name,
String def)
Gets the rawParameter attribute of the ParameterParser object
|
short |
getShortParameter(String name)
Gets the named parameter value as a short
|
short |
getShortParameter(String name,
short def)
Gets the named parameter value as a short, with a default.
|
String |
getSsnParameter(String name)
getSsnParameter.
|
String |
getStrictAlphaParameter(String name,
int maxLength)
getStrictAlphaParameter.
|
String |
getStrictNumericParameter(String name,
int maxLength)
getStrictNumericParameter.
|
String |
getStringParameter(String name)
Gets the named parameter value as a String
|
String |
getStringParameter(String name,
String def)
Gets the named parameter value as a String, with a default.
|
String |
getSubParameter(String first,
String next)
Gets the parameter named 'next' following the parameter 'first'.
|
String |
getSubParameter(String first,
String next,
String def)
Gets the subParameter attribute of the ParameterParser object
|
String |
getURLParameter(String name)
getURLParameter.
|
String |
getURLParameter(String name,
String def)
getURLParameter.
|
String |
getWordParameter(String name)
Gets the wordParameter attribute of the ParameterParser object
|
String |
getWordParameter(String name,
String def)
Gets the wordParameter attribute of the ParameterParser object
|
String |
getZipParameter(String name)
getZipParameter.
|
String |
getZipParameter(String name,
String def)
getZipParameter.
|
protected static String |
htmlEncode(String s)
htmlEncode.
|
String |
toString()
Description of the Method
|
void |
update(javax.servlet.ServletRequest request)
Description of the Method
|
public ParameterParser(javax.servlet.ServletRequest request)
request - the servlet requestpublic boolean getBooleanParameter(String name) throws ParameterNotFoundException
name - the parameter nameParameterNotFoundException - if the parameter was not foundParameterNotFoundException - if any.public boolean getBooleanParameter(String name, boolean def)
name - the parameter namedef - the default parameter valuepublic boolean getBooleanSubParameter(String first, String next, boolean def)
first - Description of the Parameternext - Description of the Parameterdef - Description of the Parameterpublic byte getByteParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter value could not be
converted to a byteParameterNotFoundException - if any.NumberFormatException - if any.public byte getByteParameter(String name, byte def)
name - the parameter namedef - the default parameter valuepublic char getCharParameter(String name) throws ParameterNotFoundException
name - the parameter nameParameterNotFoundException - if the parameter was not found or
was the empty stringParameterNotFoundException - if any.public char getCharParameter(String name, char def)
name - the parameter namedef - the default parameter valuepublic String getClassNameParameter(String name) throws ParameterNotFoundException
name - Description of the ParameterParameterNotFoundException - if any.public String getClassNameParameter(String name, String def)
name - Description of the Parameterdef - Description of the Parameterpublic double getDoubleParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter could not be converted
to a doubleParameterNotFoundException - if any.NumberFormatException - if any.public double getDoubleParameter(String name, double def)
name - the parameter namedef - the default parameter valuepublic float getFloatParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter could not be converted
to a floatParameterNotFoundException - if any.NumberFormatException - if any.public float getFloatParameter(String name, float def)
name - the parameter namedef - the default parameter valuepublic String getIPParameter(String name, String def)
name - the parameter namedef - the default parameter valuepublic String getIPParameter(String name) throws ParameterNotFoundException
name - the parameter nameParameterNotFoundException - if the parameter was not found or
was the empty stringParameterNotFoundException - if any.public int getIntParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter could not be converted
to a intParameterNotFoundException - if any.NumberFormatException - if any.public int getIntParameter(String name, int def)
name - the parameter namedef - the default parameter valuepublic long getLongParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter could not be converted
to a longParameterNotFoundException - if any.NumberFormatException - if any.public long getLongParameter(String name, long def)
name - the parameter namedef - the default parameter valuepublic String[] getMissingParameters(String[] requestuired)
requestuired - Description of the Parameterpublic Enumeration<String> getParameterNames()
public String[] getParameterValues(String name)
name - Description of the Parameterpublic String getRawParameter(String name, String def)
name - Description of the Parameterdef - Description of the Parameterpublic String getRawParameter(String name) throws ParameterNotFoundException
name - Description of the ParameterParameterNotFoundException - Description of the ExceptionParameterNotFoundException - if any.public short getShortParameter(String name) throws ParameterNotFoundException, NumberFormatException
name - the parameter nameParameterNotFoundException - if the parameter was not foundNumberFormatException - if the parameter could not be converted
to a shortParameterNotFoundException - if any.NumberFormatException - if any.public short getShortParameter(String name, short def)
name - the parameter namedef - the default parameter valuepublic String getStringParameter(String name) throws ParameterNotFoundException
name - the parameter nameParameterNotFoundException - if the parameter was not found or
was the empty stringParameterNotFoundException - if any.public String getStringParameter(String name, String def)
name - the parameter namedef - the default parameter valuepublic String getSubParameter(String first, String next, String def)
first - Description of the Parameternext - Description of the Parameterdef - Description of the Parameterpublic String getSubParameter(String first, String next) throws ParameterNotFoundException
first - Description of the Parameternext - Description of the ParameterParameterNotFoundException - Description of the ExceptionParameterNotFoundException - if any.public String getWordParameter(String name) throws ParameterNotFoundException
name - Description of the ParameterParameterNotFoundException - if any.public String getWordParameter(String name, String def)
name - Description of the Parameterdef - Description of the Parameterpublic String getStrictAlphaParameter(String name, int maxLength) throws ParameterNotFoundException, ValidationException
getStrictAlphaParameter.
name - a String object.maxLength - a int.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getStrictNumericParameter(String name, int maxLength) throws ParameterNotFoundException, ValidationException
getStrictNumericParameter.
name - a String object.maxLength - a int.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getSsnParameter(String name) throws ParameterNotFoundException, ValidationException
getSsnParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getCcnParameter(String name) throws ParameterNotFoundException, ValidationException
getCcnParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getZipParameter(String name) throws ParameterNotFoundException, ValidationException
getZipParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getZipParameter(String name, String def) throws ValidationException
getZipParameter.
name - a String object.def - a String object.String object.ValidationException - if any.public String getPhoneParameter(String name) throws ParameterNotFoundException, ValidationException
getPhoneParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getPhoneParameter(String name, String def) throws ValidationException
getPhoneParameter.
name - a String object.def - a String object.String object.ValidationException - if any.public String getEMailParameter(String name) throws ParameterNotFoundException, ValidationException
getEMailParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getEMailParameter(String name, String def) throws ValidationException
getEMailParameter.
name - a String object.def - a String object.String object.ValidationException - if any.public String getDateParameter(String name) throws ParameterNotFoundException, ValidationException
getDateParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getDateParameter(String name, String def) throws ValidationException
getDateParameter.
name - a String object.def - a String object.String object.ValidationException - if any.public String getURLParameter(String name) throws ParameterNotFoundException, ValidationException
getURLParameter.
name - a String object.String object.ParameterNotFoundException - if any.ValidationException - if any.public String getURLParameter(String name, String def) throws ValidationException
getURLParameter.
name - a String object.def - a String object.String object.ValidationException - if any.public String toString()
public void update(javax.servlet.ServletRequest request)
request - Description of the ParameterCopyright © 2006–2016 OWASP. All rights reserved.