Class RegexExtractorWrapper
- java.lang.Object
-
- org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicTestElementWrapper<T>
-
- org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicChildTestElementWrapper<T>
-
- org.anasoid.jmc.core.wrapper.jmeter.testelement.AbstractScopedTestElementWrapper<org.apache.jmeter.extractor.RegexExtractor,org.apache.jmeter.extractor.gui.RegexExtractorGui>
-
- org.anasoid.jmc.core.wrapper.jmeter.extractor.RegexExtractorWrapper
-
- All Implemented Interfaces:
java.io.Serializable,Validator,JMeterGUIWrapper<org.apache.jmeter.extractor.gui.RegexExtractorGui>,PostProcessorWrapper<org.apache.jmeter.extractor.RegexExtractor>,TestElementTreeNodeWrapper<org.apache.jmeter.extractor.RegexExtractor>,TestElementWrapper<org.apache.jmeter.extractor.RegexExtractor>
@JmcDefaultName("Regular Expression Extractor") public class RegexExtractorWrapper extends AbstractScopedTestElementWrapper<org.apache.jmeter.extractor.RegexExtractor,org.apache.jmeter.extractor.gui.RegexExtractorGui> implements PostProcessorWrapper<org.apache.jmeter.extractor.RegexExtractor>, Validator
Wrapper for RegexExtractor.- See Also:
RegexExtractor, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegexExtractorWrapper.RegexExtractorWrapperBuilder<C extends RegexExtractorWrapper,B extends RegexExtractorWrapper.RegexExtractorWrapperBuilder<C,B>>-
Nested classes/interfaces inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.AbstractScopedTestElementWrapper
AbstractScopedTestElementWrapper.AbstractScopedTestElementWrapperBuilder<T extends org.apache.jmeter.testelement.AbstractScopedTestElement,G extends org.apache.jmeter.gui.AbstractScopedJMeterGuiComponent,C extends AbstractScopedTestElementWrapper<T,G>,B extends AbstractScopedTestElementWrapper.AbstractScopedTestElementWrapperBuilder<T,G,C,B>>
-
Nested classes/interfaces inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicChildTestElementWrapper
AbstractBasicChildTestElementWrapper.AbstractBasicChildTestElementWrapperBuilder<T extends org.apache.jmeter.testelement.AbstractTestElement,C extends AbstractBasicChildTestElementWrapper<T>,B extends AbstractBasicChildTestElementWrapper.AbstractBasicChildTestElementWrapperBuilder<T,C,B>>
-
Nested classes/interfaces inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicTestElementWrapper
AbstractBasicTestElementWrapper.AbstractBasicTestElementWrapperBuilder<T extends org.apache.jmeter.testelement.AbstractTestElement,C extends AbstractBasicTestElementWrapper<T>,B extends AbstractBasicTestElementWrapper.AbstractBasicTestElementWrapperBuilder<T,C,B>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRegexExtractorWrapper(RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?> b)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?>builder()java.lang.StringgetDefaultValue()If the regular expression does not match, then the reference variable will be set to the default value.FieldToCheckgetFieldToCheck()Field To check.java.lang.Class<?>getGuiClass()Gui Test Class used by Jmeter TestElement.GUI_CLASS @See TestElementjava.lang.StringgetMatchNumber()Indicates which match to use.java.lang.StringgetRefName()The name of the JMeter variable in which to store the result.java.lang.StringgetRegex()The regular expression used to parse the response data.java.lang.StringgetTemplate()The template used to create a string from the matches found.java.lang.Class<?>getTestClass()Test Class used by Jmeter TestElement.TEST_CLASS.booleanisDefaultEmpty()If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.voidsetDefaultEmpty(boolean defaultEmpty)If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.voidsetDefaultValue(java.lang.String defaultValue)If the regular expression does not match, then the reference variable will be set to the default value.voidsetFieldToCheck(FieldToCheck fieldToCheck)Field To check.voidsetMatchNumber(java.lang.String matchNumber)Indicates which match to use.voidsetRefName(java.lang.String refName)The name of the JMeter variable in which to store the result.voidsetRegex(java.lang.String regex)The regular expression used to parse the response data.voidsetTemplate(java.lang.String template)The template used to create a string from the matches found.RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?>toBuilder()voidvalidate()Validate Test element.-
Methods inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.AbstractScopedTestElementWrapper
getScope, getScopeVariable, setScope
-
Methods inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicChildTestElementWrapper
getComment, getName, isEnabled, setComment, setEnabled, setName, toString
-
Methods inherited from class org.anasoid.jmc.core.wrapper.jmeter.testelement.basic.AbstractBasicTestElementWrapper
getChildren, getGuiClassAsString, getTags, getTestClassAsString, init, internalInit, isFullClassName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.anasoid.jmc.core.wrapper.jmeter.testelement.TestElementWrapper
getChildren, getTags, getTestClassAsString, init
-
-
-
-
Constructor Detail
-
RegexExtractorWrapper
protected RegexExtractorWrapper(RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?> b)
-
-
Method Detail
-
validate
public void validate() throws ConversionIllegalStateExceptionDescription copied from interface:ValidatorValidate Test element.- Specified by:
validatein interfaceValidator- Throws:
ConversionIllegalStateException
-
getGuiClass
public java.lang.Class<?> getGuiClass()
Description copied from interface:JMeterGUIWrapperGui Test Class used by Jmeter TestElement.GUI_CLASS @See TestElement- Specified by:
getGuiClassin interfaceJMeterGUIWrapper<org.apache.jmeter.extractor.gui.RegexExtractorGui>
-
getTestClass
public java.lang.Class<?> getTestClass()
Description copied from interface:TestElementWrapperTest Class used by Jmeter TestElement.TEST_CLASS. @See TestElement.- Specified by:
getTestClassin interfaceTestElementWrapper<org.apache.jmeter.extractor.RegexExtractor>
-
builder
public static RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?> builder()
-
toBuilder
public RegexExtractorWrapper.RegexExtractorWrapperBuilder<?,?> toBuilder()
-
getRefName
public java.lang.String getRefName()
The name of the JMeter variable in which to store the result. Also note that each group is stored as [refname]_g#, where [refname] is the string you entered as the reference name, and # is the group number, where group 0 is the entire match, group 1 is the match from the first set of parentheses, etc.
-
setRefName
public void setRefName(java.lang.String refName)
The name of the JMeter variable in which to store the result. Also note that each group is stored as [refname]_g#, where [refname] is the string you entered as the reference name, and # is the group number, where group 0 is the entire match, group 1 is the match from the first set of parentheses, etc.
-
getRegex
public java.lang.String getRegex()
The regular expression used to parse the response data. This must contain at least one set of parentheses "()" to capture a portion of the string, unless using the group $0$. Do not enclose the expression in / / - unless of course you want to match these characters as well.
-
setRegex
public void setRegex(java.lang.String regex)
The regular expression used to parse the response data. This must contain at least one set of parentheses "()" to capture a portion of the string, unless using the group $0$. Do not enclose the expression in / / - unless of course you want to match these characters as well.
-
getMatchNumber
public java.lang.String getMatchNumber()
Indicates which match to use. The regular expression may match multiple times.Use a value of zero to indicate JMeter should choose a match at random. A positive number N means to select the nth match. Negative numbers are used in conjunction with the ForEach Controller - see below.
-
setMatchNumber
public void setMatchNumber(java.lang.String matchNumber)
Indicates which match to use. The regular expression may match multiple times.Use a value of zero to indicate JMeter should choose a match at random. A positive number N means to select the nth match. Negative numbers are used in conjunction with the ForEach Controller - see below.
-
isDefaultEmpty
public boolean isDefaultEmpty()
If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.
-
setDefaultEmpty
public void setDefaultEmpty(boolean defaultEmpty)
If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.
-
getDefaultValue
public java.lang.String getDefaultValue()
If the regular expression does not match, then the reference variable will be set to the default value. This is particularly useful for debugging tests. If no default is provided, then it is difficult to tell whether the regular expression did not match, or the RE element was not processed or maybe the wrong variable is being used.However, if you have several test elements that set the same variable, you may wish to leave the variable unchanged if the expression does not match. In this case, remove the default value once debugging is complete.
-
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
If the regular expression does not match, then the reference variable will be set to the default value. This is particularly useful for debugging tests. If no default is provided, then it is difficult to tell whether the regular expression did not match, or the RE element was not processed or maybe the wrong variable is being used.However, if you have several test elements that set the same variable, you may wish to leave the variable unchanged if the expression does not match. In this case, remove the default value once debugging is complete.
-
getTemplate
public java.lang.String getTemplate()
The template used to create a string from the matches found. This is an arbitrary string with special elements to refer to groups within the regular expression. The syntax to refer to a group is: '$1$' to refer to group 1, '$2$' to refer to group 2, etc. $0$ refers to whatever the entire expression matches.
-
setTemplate
public void setTemplate(java.lang.String template)
The template used to create a string from the matches found. This is an arbitrary string with special elements to refer to groups within the regular expression. The syntax to refer to a group is: '$1$' to refer to group 1, '$2$' to refer to group 2, etc. $0$ refers to whatever the entire expression matches.
-
getFieldToCheck
public FieldToCheck getFieldToCheck()
Field To check.
-
setFieldToCheck
public void setFieldToCheck(FieldToCheck fieldToCheck)
Field To check.
-
-