public class RegexExtractor extends AbstractScopedTestElement implements PostProcessor, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
USE_BODY |
static String |
USE_BODY_AS_DOCUMENT |
static String |
USE_BODY_UNESCAPED |
static String |
USE_CODE |
static String |
USE_HDRS |
static String |
USE_MESSAGE |
static String |
USE_REQUEST_HDRS |
static String |
USE_URL |
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
RegexExtractor() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultValue()
Get the default value for the variable, which should be used, if no
matches are found
|
int |
getMatchNumber() |
String |
getMatchNumberAsString() |
String |
getRefName()
Get the prefix name of the variable to be used to store the regex matches
|
String |
getRegex()
Get the regex which is to be used
|
String |
getTemplate() |
boolean |
isEmptyDefaultValue()
Do we set default value to "" value when if it's empty
|
void |
process()
Parses the response data using regular expressions and saving the results
into variables for use later in the test.
|
void |
setDefaultEmptyValue(boolean defaultEmptyValue)
Set default value to "" value when if it's empty
|
void |
setDefaultValue(String defaultValue)
Sets the value of the variable if no matches are found
|
void |
setMatchNumber(int matchNumber)
Set which Match to use.
|
void |
setMatchNumber(String matchNumber) |
void |
setRefName(String refName)
Set the prefix name of the variable to be used to store the regex matches
|
void |
setRegex(String regex)
Set the regex to be used
|
void |
setTemplate(String template) |
void |
setUseField(String actionCommand) |
boolean |
useBody() |
boolean |
useBodyAsDocument() |
boolean |
useCode() |
boolean |
useHeaders() |
boolean |
useMessage() |
boolean |
useRequestHeaders() |
boolean |
useUnescapedBody() |
boolean |
useUrl() |
fetchScope, getSampleList, getScopeName, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
removed
public static final String USE_HDRS
public static final String USE_REQUEST_HDRS
public static final String USE_BODY
public static final String USE_BODY_UNESCAPED
public static final String USE_BODY_AS_DOCUMENT
public static final String USE_URL
public static final String USE_CODE
public static final String USE_MESSAGE
public void process()
process
in interface PostProcessor
PostProcessor.process()
public void setRegex(String regex)
regex
- The string representation of the regexpublic String getRegex()
public void setRefName(String refName)
refName
- prefix of the variables to be usedpublic String getRefName()
public void setMatchNumber(int matchNumber)
0
, which is interpreted as meaning
random.matchNumber
- The number of the match to be used, or 0
if a
random match should be used.public void setMatchNumber(String matchNumber)
public int getMatchNumber()
public String getMatchNumberAsString()
public void setDefaultValue(String defaultValue)
defaultValue
- The default value for the variablepublic void setDefaultEmptyValue(boolean defaultEmptyValue)
defaultEmptyValue
- The default value for the variablepublic String getDefaultValue()
public boolean isEmptyDefaultValue()
public void setTemplate(String template)
public String getTemplate()
public boolean useHeaders()
public boolean useRequestHeaders()
public boolean useBody()
public boolean useUnescapedBody()
public boolean useBodyAsDocument()
public boolean useUrl()
public boolean useCode()
public boolean useMessage()
public void setUseField(String actionCommand)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.