Class ConversionHelp
java.lang.Object
org.apache.jmeter.save.converters.ConversionHelp
Utility conversion routines for use with XStream
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEmbed an array of bytes as a string withencodingin a xml-cdata sectionstatic StringDecode a string ifinVersionequals1.0static StringEncode a string (if necessary) for output to a JTL file.static StringgetPropertyName(HierarchicalStreamReader reader, UnmarshallingContext context) Get the property name, updating it if necessary usingNameUpdater.static StringgetPropertyValue(HierarchicalStreamReader reader, UnmarshallingContext context, String name) Get the property value, updating it if necessary usingNameUpdater.static StringgetUpgradePropertyName(String name, UnmarshallingContext context) Update a property name usingNameUpdater.static StringgetUpgradePropertyValue(String name, String value, UnmarshallingContext context) Update a property value usingNameUpdater.getCurrentName(String, String, String).static booleanisSpecialProperty(String name) Check whethernamespecifies a special propertystatic voidrestoreSpecialProperties(TestElement testElement, HierarchicalStreamReader reader) Restore the special properties: TestElement.GUI_CLASS TestElement.TEST_CLASS TestElement.NAME TestElement.ENABLEDstatic voidsaveSpecialProperties(TestElement testElement, HierarchicalStreamWriter writer) Save the special properties: TestElement.GUI_CLASS TestElement.TEST_CLASS TestElement.NAME TestElement.ENABLEDstatic voidstatic void
-
Field Details
-
ATT_CLASS
- See Also:
-
ATT_NAME
- See Also:
-
ATT_ELEMENT_TYPE
- See Also:
-
-
Constructor Details
-
ConversionHelp
public ConversionHelp()
-
-
Method Details
-
setInVersion
-
setOutVersion
-
encode
-
decode
-
cdata
Embed an array of bytes as a string withencodingin a xml-cdata section- Parameters:
chars- bytes to be encoded and embeddedencoding- the encoding to be used- Returns:
- the encoded string embedded in a xml-cdata section
- Throws:
UnsupportedEncodingException- when the bytes can not be encoded usingencoding
-
isSpecialProperty
Check whethernamespecifies a special property- Parameters:
name- the name of the property to be checked- Returns:
trueifnameis the name of a special property
-
getPropertyName
Get the property name, updating it if necessary usingNameUpdater.- Parameters:
reader- where to read the name attributecontext- the unmarshalling context- Returns:
- the property name, may be null if the property has been deleted.
- See Also:
-
getPropertyValue
public static String getPropertyValue(HierarchicalStreamReader reader, UnmarshallingContext context, String name) Get the property value, updating it if necessary usingNameUpdater. Do not use for GUI_CLASS or TEST_CLASS.- Parameters:
reader- where to read the valuecontext- the unmarshalling contextname- the name of the property- Returns:
- the property value, updated if necessary.
- See Also:
-
getUpgradePropertyName
Update a property name usingNameUpdater.- Parameters:
name- the original property namecontext- the unmarshalling context- Returns:
- the property name, may be null if the property has been deleted.
-
getUpgradePropertyValue
public static String getUpgradePropertyValue(String name, String value, UnmarshallingContext context) Update a property value usingNameUpdater.getCurrentName(String, String, String). Do not use for GUI_CLASS or TEST_CLASS.- Parameters:
name- the original property namevalue- the original property valuecontext- the unmarshalling context- Returns:
- the property value, updated if necessary
-
saveSpecialProperties
Save the special properties:- TestElement.GUI_CLASS
- TestElement.TEST_CLASS
- TestElement.NAME
- TestElement.ENABLED
- Parameters:
testElement- element for which the special properties should be savedwriter-in which the special properties should be savedinvalid reference
HierarchicalStreamWriter
-
restoreSpecialProperties
public static void restoreSpecialProperties(TestElement testElement, HierarchicalStreamReader reader) Restore the special properties:- TestElement.GUI_CLASS
- TestElement.TEST_CLASS
- TestElement.NAME
- TestElement.ENABLED
- Parameters:
testElement- in which the special properties should be restoredreader-from which the special properties should be restoredinvalid reference
HierarchicalStreamReader
-