public class RequestParameterBuilder
extends java.lang.Object
| Constructor and Description |
|---|
RequestParameterBuilder()
Creates a builder instance.
|
RequestParameterBuilder(boolean useCurrentRequest)
Creates a builder instance wihout URL or with the current request URL.
|
RequestParameterBuilder(java.lang.String url)
Creates a builder instance by the given URL.
|
RequestParameterBuilder(java.lang.String url,
JsonConverter jsonConverter)
Creates a builder instance by the given URL.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
build()
Builds the end result.
|
java.lang.String |
encode(java.lang.Object value)
Encodes given value with a proper encoding.
|
java.lang.String |
encodeJson(java.lang.Object value)
Convertes give value to JSON without to know the data type and encodes the converted value with a proper encoding.
|
java.lang.String |
encodeJson(java.lang.Object value,
java.lang.String type)
Convertes give value to JSON and encodes the converted value with a proper encoding.
|
RequestParameterBuilder |
param(java.lang.String name,
java.lang.Object value)
Adds a request parameter to the URL.
|
RequestParameterBuilder |
paramJson(java.lang.String name,
java.lang.Object value)
Adds a request parameter to the URL without specifying a data type of the given parameter value.
|
RequestParameterBuilder |
paramJson(java.lang.String name,
java.lang.Object value,
java.lang.String type)
Adds a request parameter to the URL with specifying a data type of the given parameter value.
|
RequestParameterBuilder |
reset()
Resets the internal state in order to be reused.
|
public RequestParameterBuilder()
public RequestParameterBuilder(boolean useCurrentRequest)
useCurrentRequest - boolean flag if the current request URL should be used or notpublic RequestParameterBuilder(java.lang.String url)
url - URLpublic RequestParameterBuilder(java.lang.String url,
JsonConverter jsonConverter)
url - URLjsonConverter - specific JsonConverter. It should extends JsonConverter from PrimeFaces Extensions. If null,
the default implementation JsonExposeAwareConverter is used.public RequestParameterBuilder paramJson(java.lang.String name, java.lang.Object value) throws java.io.UnsupportedEncodingException
name - name of the request parametervalue - value of the request parameterjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic RequestParameterBuilder paramJson(java.lang.String name, java.lang.Object value, java.lang.String type) throws java.io.UnsupportedEncodingException
name - name of the request parametervalue - value of the request parametertype - data type of the value object. Any primitive type, array, non generic or generic type is supported. Data type
is sometimes required to convert a value to a JSON representation. All data types should be fully qualified.
Examples: "boolean" "int" "long[]" "java.lang.String" "java.util.Date"
"java.util.Collectionjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic RequestParameterBuilder param(java.lang.String name, java.lang.Object value) throws java.io.UnsupportedEncodingException
name - name of the request parametervalue - value of the request parameterjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic java.lang.String encode(java.lang.Object value)
throws java.io.UnsupportedEncodingException
value - value to be encodedjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic java.lang.String encodeJson(java.lang.Object value,
java.lang.String type)
throws java.io.UnsupportedEncodingException
value - value to be converted and encodedtype - data type of the value object. Any primitive type, array, non generic or generic type is supported. Data type
is sometimes required to convert a value to a JSON representation. All data types should be fully qualified.
Examples: "boolean" "int" "long[]" "java.lang.String" "java.util.Date"
"java.util.Collectionjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic java.lang.String encodeJson(java.lang.Object value)
throws java.io.UnsupportedEncodingException
value - value to be converted and encodedjava.io.UnsupportedEncodingException - DOCUMENT_MEpublic java.lang.String build()
public RequestParameterBuilder reset()
Copyright © 2011-2015. All Rights Reserved.