public abstract class VariantAbstractQuery extends Object implements Variant
Constructor and Description |
---|
VariantAbstractQuery() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
buildMessage(HttpMessage msg,
String query)
Build the message content setting the query string according to the Variant specific
implementation
|
protected String |
getEscapedName(HttpMessage msg,
String name)
Gets parameter's name in encoded/escaped form.
|
protected abstract String |
getEscapedValue(HttpMessage msg,
String value)
Return escaped mutate of the value.
|
List<NameValuePair> |
getParamList()
Gets the list of parameters handled by this variant.
|
protected abstract String |
getUnescapedValue(String value)
Return unescaped mutate of the value.
|
void |
setAddQueryParam(boolean addQueryParam) |
String |
setEscapedParameter(HttpMessage msg,
NameValuePair originalPair,
String name,
String value) |
String |
setParameter(HttpMessage msg,
NameValuePair originalPair,
String name,
String value)
If name and value = null, not to append entire parameter.
|
protected void |
setParameters(int type,
List<NameValuePair> parameters)
Sets the given
parameters of the given type as the list of parameters handled
by this variant. |
protected void |
setParams(int type,
Map<String,String> params)
Deprecated.
(2.5.0) use
setParameters(int, List) instead. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLeafName, getTreePath, setMessage, setParameters
protected abstract void buildMessage(HttpMessage msg, String query)
msg
- the message object we need to modifyquery
- the query string we need to set inside the messageprotected abstract String getEscapedValue(HttpMessage msg, String value)
msg
- value
- protected String getEscapedName(HttpMessage msg, String name)
Default implementation is to URL encode the name.
msg
- the message that contains the parametername
- the name to escapeURLEncoder.encode(String, String)
protected abstract String getUnescapedValue(String value)
value
- @Deprecated protected void setParams(int type, Map<String,String> params)
setParameters(int, List)
instead.protected void setParameters(int type, List<NameValuePair> parameters)
parameters
of the given type
as the list of parameters handled
by this variant.
The names and values of the parameters are expected to be in decoded form.
type
- the type of parametersparameters
- the actual parameters to addIllegalArgumentException
- if parameters
is null
.getParamList()
,
NameValuePair.TYPE_QUERY_STRING
,
NameValuePair.TYPE_POST_DATA
public List<NameValuePair> getParamList()
Variant
getParamList
in interface Variant
List
containing the parameterspublic String setParameter(HttpMessage msg, NameValuePair originalPair, String name, String value)
setParameter
in interface Variant
public String setEscapedParameter(HttpMessage msg, NameValuePair originalPair, String name, String value)
setEscapedParameter
in interface Variant
public void setAddQueryParam(boolean addQueryParam)