Top Description Fields Constructors Methods
javax.ws.rs.core

public Class Form

extends Object
Class Inheritance
Imports
java.util.LinkedHashMap, .List

Represents the the HTML form data request entity encoded using the "application/x-www-form-urlencoded" content type.
Author
Marek Potociar
Since
2.0

Field Summary

Modifier and TypeField and Description
private final MultivaluedMap<String, String>

Constructor Summary

AccessConstructor and Description
public
Form()

Create a new form data instance.

public
Form(final String
form parameter name.
parameterName
,
final String
form parameter value.
parameterValue
)

Create a new form data instance with a single parameter entry.

public
Form(final MultivaluedMap<String, String>
form data store used by the created form instance.
store
)

Create a new form data instance and register a custom underlying parameter store.

Method Summary

Modifier and TypeMethod and Description
public MultivaluedMap<String, String>

Returns:

form represented as multivalued map.
asMap
()

Returns multivalued map representation of the form.

public Form

Returns:

updated Form instance.
param
(final String
name of the parameter.
name
,
final String
new parameter value to be added.
value
)

Adds a new value to the specified form parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parametersback to summary
private final MultivaluedMap<String, String> parameters

Constructor Detail

Formback to summary
public Form()

Create a new form data instance.

The underlying form parameter store is configured to preserve the insertion order of the parameters. I.e. parameters can be iterated in the same order as they were inserted into the Form.

Formback to summary
public Form(final String parameterName, final String parameterValue)

Create a new form data instance with a single parameter entry.

The underlying form parameter store is configured to preserve the insertion order of the parameters. I.e. parameters can be iterated in the same order as they were inserted into the Form.

Parameters
parameterName:String

form parameter name.

parameterValue:String

form parameter value.

Formback to summary
public Form(final MultivaluedMap<String, String> store)

Create a new form data instance and register a custom underlying parameter store.

This method is useful in situations when a custom parameter store is needed in order to change the default parameter iteration order, improve performance or facilitate other custom requirements placed on the parameter store.

Parameters
store:MultivaluedMap<String, String>

form data store used by the created form instance.

Method Detail

asMapback to summary
public MultivaluedMap<String, String> asMap()

Returns multivalued map representation of the form.

Returns:MultivaluedMap<String, String>

form represented as multivalued map.

See Also
MultivaluedMap
paramback to summary
public Form param(final String name, final String value)

Adds a new value to the specified form parameter.

Parameters
name:String

name of the parameter.

value:String

new parameter value to be added.

Returns:Form

updated Form instance.