|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.save.converters.ConversionHelp
public class ConversionHelp
Utility conversion routines for use with XStream
Field Summary | |
---|---|
static String |
ATT_CLASS
|
static String |
ATT_ELEMENT_TYPE
|
static String |
ATT_NAME
|
Constructor Summary | |
---|---|
ConversionHelp()
|
Method Summary | |
---|---|
static String |
cdata(byte[] chars,
String encoding)
Embed an array of bytes as a string with encoding in a
xml-cdata section |
static String |
decode(String p)
Decode a string if inVersion equals 1.0 |
static String |
encode(String p)
Encode a string (if necessary) for output to a JTL file. |
static String |
getPropertyName(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Get the property name, updating it if necessary using NameUpdater . |
static String |
getPropertyValue(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context,
String name)
Get the property value, updating it if necessary using NameUpdater . |
static String |
getUpgradePropertyName(String name,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Update a property name using NameUpdater . |
static String |
getUpgradePropertyValue(String name,
String value,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Update a property value using NameUpdater.getCurrentName(String, String, String) . |
static boolean |
isSpecialProperty(String name)
Check whether name specifies a special property |
static void |
restoreSpecialProperties(TestElement testElement,
com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
Restore the special properties: TestElement.GUI_CLASS TestElement.TEST_CLASS TestElement.NAME TestElement.ENABLED |
static void |
saveSpecialProperties(TestElement testElement,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer)
Save the special properties: TestElement.GUI_CLASS TestElement.TEST_CLASS TestElement.NAME TestElement.ENABLED |
static void |
setInVersion(String v)
|
static void |
setOutVersion(String v)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ATT_CLASS
public static final String ATT_NAME
public static final String ATT_ELEMENT_TYPE
Constructor Detail |
---|
public ConversionHelp()
Method Detail |
---|
public static void setInVersion(String v)
public static void setOutVersion(String v)
public static String encode(String p)
p
- string to encode
public static String decode(String p)
inVersion
equals 1.0
p
- the string to be decoded
public static String cdata(byte[] chars, String encoding) throws UnsupportedEncodingException
encoding
in a
xml-cdata section
chars
- bytes to be encoded and embeddedencoding
- the encoding to be used
UnsupportedEncodingException
- when the bytes can not be encoded using encoding
public static boolean isSpecialProperty(String name)
name
specifies a special property
name
- the name of the property to be checked
true
if name
is the name of a special
propertypublic static String getPropertyName(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
NameUpdater
.
reader
- where to read the name attributecontext
- the unmarshalling context
getUpgradePropertyName(String, UnmarshallingContext)
public static String getPropertyValue(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, String name)
NameUpdater
.
Do not use for GUI_CLASS or TEST_CLASS.
reader
- where to read the valuecontext
- the unmarshalling contextname
- the name of the property
getUpgradePropertyValue(String, String, UnmarshallingContext)
public static String getUpgradePropertyName(String name, com.thoughtworks.xstream.converters.UnmarshallingContext context)
NameUpdater
.
name
- the original property namecontext
- the unmarshalling context
public static String getUpgradePropertyValue(String name, String value, com.thoughtworks.xstream.converters.UnmarshallingContext context)
NameUpdater.getCurrentName(String, String, String)
.
Do not use for GUI_CLASS or TEST_CLASS.
name
- the original property namevalue
- the original property valuecontext
- the unmarshalling context
public static void saveSpecialProperties(TestElement testElement, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer)
testElement
- element for which the special properties should be savedwriter
- HierarchicalStreamWriter
in which the special
properties should be savedpublic static void restoreSpecialProperties(TestElement testElement, com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
testElement
- in which the special properties should be restoredreader
- HierarchicalStreamReader
from which the special
properties should be restored
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |