public class HeaderManager extends ConfigTestElement implements Serializable, Replaceable
Modifier and Type | Field and Description |
---|---|
static String |
HEADERS |
PASSWORD, USERNAME
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
HeaderManager() |
Modifier and Type | Method and Description |
---|---|
void |
add()
Add an empty header.
|
void |
add(Header h)
Add a header.
|
void |
addFile(String headerFile)
Add header data from a file.
|
void |
clear()
Clear the TestElement of all data.
|
Header |
get(int i)
Return the header at index i.
|
Class<? extends String> |
getColumnClass(int column) |
int |
getColumnCount() |
String |
getColumnName(int column) |
Header |
getHeader(int row) |
CollectionProperty |
getHeaders()
Get the collection of JMeterProperty entries representing the headers.
|
HeaderManager |
merge(TestElement element)
Merge the attributes with a another HeaderManager's attributes.
|
HeaderManager |
merge(TestElement element,
boolean preferLocalValues)
Deprecated.
since 3.2, use
merge(TestElement) as this method will be removed in a future version |
void |
remove(int index)
Remove a header.
|
void |
removeHeaderNamed(String name)
Remove from Headers the header named name
|
int |
replace(String regex,
String replaceBy,
boolean caseSensitive)
Replace in object by replaceBy
|
void |
save(String headFile)
Save the header data to a file.
|
int |
size()
Return the number of headers.
|
addConfigElement, addTestElement, expectsModification
addPropertiesValues, addProperty, addProperty, canRemove, 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
clone
removed
public static final String HEADERS
public void clear()
clear
in interface TestElement
clear
in class AbstractTestElement
public CollectionProperty getHeaders()
public int getColumnCount()
public String getColumnName(int column)
public Header getHeader(int row)
public void save(String headFile) throws IOException
headFile
- name of the file to store headers into. If name is relative
the system property user.dir
will be prependedIOException
- if writing the headers failspublic void addFile(String headerFile) throws IOException
headerFile
- name of the file to read headers from. If name is relative the
system property user.dir
will be prependedIOException
- if reading headers failspublic void add()
public void remove(int index)
index
- index from the header to removepublic int size()
public Header get(int i)
i
- index of the header to getHeader
at index i
public void removeHeaderNamed(String name)
name
- header name@Deprecated public HeaderManager merge(TestElement element, boolean preferLocalValues)
merge(TestElement)
as this method will be removed in a future versionelement
- The object to be merged withpreferLocalValues
- Not usedIllegalArgumentException
- if element
is not an instance of
HeaderManager
public HeaderManager merge(TestElement element)
element
- The object to be merged withIllegalArgumentException
- if element
is not an instance of
HeaderManager
public int replace(String regex, String replaceBy, boolean caseSensitive) throws Exception
Replaceable
replace
in interface Replaceable
regex
- Regular expression to search forreplaceBy
- Text used as replacementcaseSensitive
- flag, whether search should be done case sensitiveException
- when something fails while replacingCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.