Package org.restlet.data
Class Form
Form which is a specialized modifiable list of parameters.
- Author:
- Jerome Louvel
-
Field Summary
Fields inherited from class org.restlet.util.Series
EMPTY_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionForm()Empty constructor.Form(int initialCapacity) Constructor.Constructor.Constructor.Constructor.Constructor.Form(String queryString, CharacterSet characterSet) Constructor.Form(String queryString, CharacterSet characterSet, boolean decode) Constructor.Form(String parametersString, CharacterSet characterSet, char separator) Constructor.Form(String parametersString, CharacterSet characterSet, char separator, boolean decode) Constructor.Constructor.Form(Representation webForm) Constructor.Form(Representation webForm, boolean decode) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateEntry(String name, String value) Creates a new entry.encode()Encodes the form using the standard URI encoding mechanism and the UTF-8 character set.encode(CharacterSet characterSet) URL encodes the form.encode(CharacterSet characterSet, char separator) URL encodes the form.Formats the form as a matrix path string.getMatrixString(CharacterSet characterSet) Formats the form as a query string.Formats the form as a query string.getQueryString(CharacterSet characterSet) Formats the form as a query string.Returns the form as a Web representation (MediaType.APPLICATION_WWW_FORM).getWebRepresentation(CharacterSet characterSet) Returns the form as a Web representation (MediaType.APPLICATION_WWW_FORM).Methods inherited from class org.restlet.util.Series
add, copyTo, getFirst, getFirst, getFirstValue, getFirstValue, getFirstValue, getFirstValue, getNames, getValues, getValues, getValuesArray, getValuesArray, getValuesArray, getValuesArray, getValuesMap, removeAll, removeAll, removeFirst, removeFirst, set, set, subList, subList, subList, unmodifiableSeriesMethods inherited from class org.restlet.util.WrapperList
add, add, addAll, addAll, clear, contains, containsAll, equals, get, getDelegate, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
Form
public Form()Empty constructor. -
Form
public Form(int initialCapacity) Constructor.- Parameters:
initialCapacity- The initial list capacity.
-
Form
Constructor.- Parameters:
delegate- The delegate list.
-
Form
Constructor.- Parameters:
webForm- The URL encoded Web form.
-
Form
Constructor.- Parameters:
webForm- The URL encoded Web form.
-
Form
Constructor. Uses UTF-8 as the character set for encoding non-ASCII characters.- Parameters:
queryString- The Web form parameters as a string.
-
Form
Constructor. Uses UTF-8 as the character set for encoding non-ASCII characters.- Parameters:
queryString- The Web form parameters as a string.decode- Indicates if the names and values should be automatically decoded.
-
Form
Constructor. Uses UTF-8 as the character set for encoding non-ASCII characters.- Parameters:
parametersString- The parameters string to parse.separator- The separator character to append between parameters.
-
Form
Constructor. Uses UTF-8 as the character set for encoding non-ASCII characters.- Parameters:
parametersString- The parameters string to parse.separator- The separator character to append between parameters.decode- Indicates if the names and values should be automatically decoded.
-
Form
Constructor.- Parameters:
queryString- The Web form parameters as a string.characterSet- The supported character encoding.
-
Form
Constructor.- Parameters:
queryString- The Web form parameters as a string.characterSet- The supported character encoding.decode- Indicates if the names and values should be automatically decoded.
-
Form
Constructor.- Parameters:
parametersString- The parameters string to parse.characterSet- The supported character encoding.separator- The separator character to append between parameters.
-
Form
Constructor.- Parameters:
parametersString- The parameters string to parse.characterSet- The supported character encoding.separator- The separator character to append between parameters.decode- Indicates if the names and values should be automatically decoded.
-
-
Method Details
-
createEntry
Description copied from class:SeriesCreates a new entry.- Overrides:
createEntryin classSeries<Parameter>- Parameters:
name- The name of the entry.value- The value of the entry.- Returns:
- A new entry.
-
encode
Encodes the form using the standard URI encoding mechanism and the UTF-8 character set.- Returns:
- The encoded form.
- Throws:
IOException
-
encode
URL encodes the form. The '&' character is used as a separator.- Parameters:
characterSet- The supported character encoding.- Returns:
- The encoded form.
- Throws:
IOException
-
encode
URL encodes the form.- Parameters:
characterSet- The supported character encoding.separator- The separator character to append between parameters.- Returns:
- The encoded form.
- Throws:
IOException
-
getMatrixString
Formats the form as a matrix path string. Uses UTF-8 as the character set for encoding non-ASCII characters.- Returns:
- The form as a matrix string.
- See Also:
-
getMatrixString
Formats the form as a query string.- Parameters:
characterSet- The supported character encoding.- Returns:
- The form as a matrix string.
- See Also:
-
getQueryString
Formats the form as a query string. Uses UTF-8 as the character set for encoding non-ASCII characters.- Returns:
- The form as a query string.
-
getQueryString
Formats the form as a query string.- Parameters:
characterSet- The supported character encoding.- Returns:
- The form as a query string.
-
getWebRepresentation
Returns the form as a Web representation (MediaType.APPLICATION_WWW_FORM). Uses UTF-8 as the character set for encoding non-ASCII characters.- Returns:
- The form as a Web representation.
-
getWebRepresentation
Returns the form as a Web representation (MediaType.APPLICATION_WWW_FORM).- Parameters:
characterSet- The supported character encoding.- Returns:
- The form as a Web representation.
-