public class ConversionHelp extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ATT_CLASS |
static String |
ATT_ELEMENT_TYPE |
static String |
ATT_NAME |
Constructor and Description |
---|
ConversionHelp() |
Modifier and Type | Method and Description |
---|---|
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) |
public static final String ATT_CLASS
public static final String ATT_NAME
public static final String ATT_ELEMENT_TYPE
public static void setInVersion(String v)
public static void setOutVersion(String v)
public static String encode(String p)
p
- string to encodepublic static String decode(String p)
inVersion
equals 1.0
p
- the string to be decodedpublic static String cdata(byte[] chars, String encoding) throws UnsupportedEncodingException
encoding
in a
xml-cdata sectionchars
- bytes to be encoded and embeddedencoding
- the encoding to be usedUnsupportedEncodingException
- when the bytes can not be encoded using encoding
public static boolean isSpecialProperty(String name)
name
specifies a special propertyname
- the name of the property to be checkedtrue
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 contextgetUpgradePropertyName(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 propertygetUpgradePropertyValue(String, String, UnmarshallingContext)
public static String getUpgradePropertyName(String name, com.thoughtworks.xstream.converters.UnmarshallingContext context)
NameUpdater
.name
- the original property namecontext
- the unmarshalling contextpublic 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 contextpublic 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 restoredCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.