Constructor and Description |
---|
VariantCustom(ScriptWrapper wrapper,
ExtensionScript extension)
Create a new Custom Variant using the specific script
|
VariantCustom(ScriptWrapper wrapper,
VariantScript script,
ExtensionScript extension)
Constructs a
VariantCustom with the given values. |
Modifier and Type | Method and Description |
---|---|
void |
addParam(String name,
String value,
int type)
Support method to add a new param to this custom variant
|
void |
addParamHeader(String name,
String value)
Support method to add a new Header param to this custom variant
|
void |
addParamPost(String name,
String value)
Support method to add a new PostData param to this custom variant
|
void |
addParamQuery(String name,
String value)
Support method to add a new QueryString param to this custom variant
|
String |
decodeBase64(String value)
Support method to decode a Base64 string
|
String |
encodeBase64(String value)
Support method to encode a string to Base64
|
NameValuePair |
getCurrentParam()
Gets the current parameter being tested.
|
String |
getLeafName(String nodeName,
HttpMessage msg)
Gets the name of the node to be used for the given
msg in the Site Map. |
List<NameValuePair> |
getParamList()
Give back the list of retrieved parameters
|
String |
getParamName(int index)
Support method to get back the name of the n-th parameter
|
int |
getParamNumber()
Get the number of parameters currently available for this variant
|
String |
getParamValue(int index)
Support method to get back the value of the n-th parameter
|
String |
getStandardLeafName(String nodeName,
HttpMessage msg,
List<NameValuePair> params)
The standard name given to nodes in the sites tree for the given parameters
|
List<String> |
getTreePath(HttpMessage msg)
Returns the tree path elements for the given
message . |
boolean |
isBase64(String value)
Support method to verify if the content is a Base64 string
|
String |
setEscapedParameter(HttpMessage msg,
NameValuePair originalPair,
String param,
String value) |
void |
setMessage(HttpMessage msg)
Set the current message that this Variant has to scan
|
String |
setParameter(HttpMessage msg,
NameValuePair originalPair,
String param,
String value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setParameters
public VariantCustom(ScriptWrapper wrapper, ExtensionScript extension)
wrapper
- the script wrapper that need to be set for this Variantextension
- the general extension Script objectpublic VariantCustom(ScriptWrapper wrapper, VariantScript script, ExtensionScript extension)
VariantCustom
with the given values.wrapper
- the script wrapper.script
- the script.extension
- the script extension.public void setMessage(HttpMessage msg)
setMessage
in interface Variant
msg
- the message object (remember Response is not set)public List<NameValuePair> getParamList()
getParamList
in interface Variant
public String getParamName(int index)
index
- the index of the requested parameterpublic String getParamValue(int index)
index
- the index of the requested parameterpublic int getParamNumber()
public NameValuePair getCurrentParam()
null
if none.public void addParam(String name, String value, int type)
name
- the param namevalue
- the value of this parametertype
- the type of this parameterpublic void addParamQuery(String name, String value)
name
- the param namevalue
- the value of this parameterpublic void addParamPost(String name, String value)
name
- the param namevalue
- the value of this parameterpublic void addParamHeader(String name, String value)
name
- the param namevalue
- the value of this parameterpublic String encodeBase64(String value)
value
- the value that need to be encodedpublic String decodeBase64(String value)
value
- the value that need to be decodedpublic boolean isBase64(String value)
value
- the value that need to be checkedpublic String setParameter(HttpMessage msg, NameValuePair originalPair, String param, String value)
setParameter
in interface Variant
public String setEscapedParameter(HttpMessage msg, NameValuePair originalPair, String param, String value)
setEscapedParameter
in interface Variant
public String getStandardLeafName(String nodeName, HttpMessage msg, List<NameValuePair> params)
nodeName
- the name of the node, typically the last element of the pathmsg
- the messageparams
- the url and post parameters for the given messagepublic String getLeafName(String nodeName, HttpMessage msg)
Variant
msg
in the Site Map. Returning
null is taken to mean use the default name. This is currently the last element of the path
(given in nodeName
) followed by the url parameter names in brackets (if any) followed
by the form parameter names in brackets (if any).getLeafName
in interface Variant
nodeName
- the last element of the pathmsg
- the messagepublic List<String> getTreePath(HttpMessage msg)
Variant
message
. Returning null is taken to mean
use the default methods for obtaining tree path elements. This will determine the position of
this message in the Site Map.
By default the elements are returned for the following URL are:
getTreePath
in interface Variant
List
containing the tree path elements