|
||||||||||
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(CharSequence name,
CharSequence value,
CharacterSet characterSet)
Creates a parameter. |
static Parameter |
getFirstParameter(Logger logger,
Representation post,
String name)
Reads the first parameter with the given name. |
static Parameter |
getFirstParameter(Logger logger,
String query,
String name,
CharacterSet characterSet)
Reads the first parameter with the given name. |
static Object |
getParameter(Logger logger,
Representation form,
String name)
Reads the parameters with the given name. If multiple values are found, a list is returned created. |
static Object |
getParameter(Logger logger,
String query,
String name,
CharacterSet characterSet)
Reads the parameters with the given name. If multiple values are found, a list is returned created. |
static void |
getParameters(Logger logger,
Representation post,
Map<String,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(Logger logger,
String query,
Map<String,Object> parameters,
CharacterSet characterSet)
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 |
parsePost(Logger logger,
Form form,
Representation post)
Parses a post into a given form. |
static void |
parseQuery(Logger logger,
Form form,
String query,
CharacterSet characterSet)
Parses a query 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 void parseQuery(Logger logger, Form form, String query, CharacterSet characterSet)
logger
- The logger.form
- The target form.query
- Query string.characterSet
- The supported character encoding.public static void parsePost(Logger logger, Form form, Representation post)
logger
- The logger.form
- The target form.post
- The posted form.public static void getParameters(Logger logger, String query, Map<String,Object> parameters, CharacterSet characterSet) throws IOException
logger
- The logger.query
- The query string.parameters
- The parameters map controlling the reading.characterSet
- The supported character encoding.
IOException
public static void getParameters(Logger logger, Representation post, Map<String,Object> parameters) throws IOException
logger
- The logger.post
- The web form representation.parameters
- The parameters map controlling the reading.
IOException
public static Parameter getFirstParameter(Logger logger, String query, String name, CharacterSet characterSet) throws IOException
logger
- The logger.query
- The query string.name
- The parameter name to match.characterSet
- The supported character encoding.
IOException
public static Parameter getFirstParameter(Logger logger, Representation post, String name) throws IOException
logger
- The logger.post
- The web form representation.name
- The parameter name to match.
IOException
public static Object getParameter(Logger logger, String query, String name, CharacterSet characterSet) throws IOException
logger
- The logger.query
- The query string.name
- The parameter name to match.characterSet
- The supported character encoding.
IOException
public static Object getParameter(Logger logger, Representation form, String name) throws IOException
logger
- The logger.form
- The web form representation.name
- The parameter name to match.
IOException
public static Parameter create(CharSequence name, CharSequence value, CharacterSet characterSet) throws IOException
name
- The parameter name buffer.value
- The parameter value buffer (can be null).characterSet
- The supported character encoding.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |