|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.noelios.restlet.util.FormUtils
public class FormUtils
Representation of a Web form containing submitted parameters.
Constructor Summary | |
---|---|
FormUtils()
|
Method Summary | |
---|---|
static Parameter |
create(java.lang.CharSequence name,
java.lang.CharSequence value,
boolean decode,
CharacterSet characterSet)
Creates a parameter. |
static Parameter |
getFirstParameter(Representation post,
java.lang.String name)
Reads the first parameter with the given name. |
static Parameter |
getFirstParameter(java.lang.String query,
java.lang.String name,
CharacterSet characterSet,
char separator)
Reads the first parameter with the given name. |
static java.lang.Object |
getParameter(Representation form,
java.lang.String name)
Reads the parameters with the given name. If multiple values are found, a list is returned created. |
static java.lang.Object |
getParameter(java.lang.String query,
java.lang.String name,
CharacterSet characterSet,
char separator)
Reads the parameters with the given name. If multiple values are found, a list is returned created. |
static void |
getParameters(Representation post,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Reads the parameters whose name is a key in the given map. If a matching parameter is found, its value is put in the map. If multiple values are found, a list is created and set in the map. |
static void |
getParameters(java.lang.String parametersString,
java.util.Map<java.lang.String,java.lang.Object> parameters,
CharacterSet characterSet,
char separator)
Reads the parameters whose name is a key in the given map. If a matching parameter is found, its value is put in the map. If multiple values are found, a list is created and set in the map. |
static void |
parse(Form form,
Representation post)
Parses a post into a given form. |
static void |
parse(Form form,
java.lang.String parametersString,
CharacterSet characterSet,
boolean decode,
char separator)
Parses a parameters string into a given form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormUtils()
Method Detail |
---|
public static Parameter create(java.lang.CharSequence name, java.lang.CharSequence value, boolean decode, CharacterSet characterSet)
name
- The parameter name buffer.value
- The parameter value buffer (can be null).decode
- If true, the name and values are decoded with the given
CharacterSet
, if false, than nothing is decoded.characterSet
- The supported character encoding.
public static Parameter getFirstParameter(Representation post, java.lang.String name) throws java.io.IOException
post
- The web form representation.name
- The parameter name to match.
java.io.IOException
public static Parameter getFirstParameter(java.lang.String query, java.lang.String name, CharacterSet characterSet, char separator) throws java.io.IOException
query
- The query string.name
- The parameter name to match.characterSet
- The supported character encoding.separator
- The separator character to append between parameters.
java.io.IOException
public static java.lang.Object getParameter(Representation form, java.lang.String name) throws java.io.IOException
form
- The web form representation.name
- The parameter name to match.
java.io.IOException
- If the parameters could not be read.public static java.lang.Object getParameter(java.lang.String query, java.lang.String name, CharacterSet characterSet, char separator) throws java.io.IOException
query
- The query string.name
- The parameter name to match.characterSet
- The supported character encoding.separator
- The separator character to append between parameters.
java.io.IOException
- If the parameters could not be read.public static void getParameters(Representation post, java.util.Map<java.lang.String,java.lang.Object> parameters) throws java.io.IOException
post
- The web form representation.parameters
- The parameters map controlling the reading.
java.io.IOException
- If the parameters could not be read.public static void getParameters(java.lang.String parametersString, java.util.Map<java.lang.String,java.lang.Object> parameters, CharacterSet characterSet, char separator) throws java.io.IOException
parametersString
- The query string.parameters
- The parameters map controlling the reading.characterSet
- The supported character encoding.separator
- The separator character to append between parameters.
java.io.IOException
- If the parameters could not be read.public static void parse(Form form, Representation post)
form
- The target form.post
- The posted form.public static void parse(Form form, java.lang.String parametersString, CharacterSet characterSet, boolean decode, char separator)
form
- The target form.parametersString
- The parameters string.characterSet
- The supported character encoding.decode
- Indicates if the query parameters should be decoded using the
given character set.separator
- The separator character to append between parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |