public class ConversionHelp
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATT_CLASS |
static java.lang.String |
ATT_ELEMENT_TYPE |
static java.lang.String |
ATT_NAME |
Constructor and Description |
---|
ConversionHelp() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cdata(byte[] chars,
java.lang.String encoding)
Embed an array of bytes as a string with
encoding in a
xml-cdata section |
static java.lang.String |
decode(java.lang.String p)
Decode a string if
inVersion equals 1.0 |
static java.lang.String |
encode(java.lang.String p)
Encode a string (if necessary) for output to a JTL file.
|
static java.lang.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 java.lang.String |
getPropertyValue(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context,
java.lang.String name)
Get the property value, updating it if necessary using
NameUpdater . |
static java.lang.String |
getUpgradePropertyName(java.lang.String name,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Update a property name using
NameUpdater . |
static java.lang.String |
getUpgradePropertyValue(java.lang.String name,
java.lang.String value,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Update a property value using
NameUpdater.getCurrentName(String, String, String) . |
static boolean |
isSpecialProperty(java.lang.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(java.lang.String v) |
static void |
setOutVersion(java.lang.String v) |
public static final java.lang.String ATT_CLASS
public static final java.lang.String ATT_NAME
public static final java.lang.String ATT_ELEMENT_TYPE
public static void setInVersion(java.lang.String v)
public static void setOutVersion(java.lang.String v)
public static java.lang.String encode(java.lang.String p)
p
- string to encodepublic static java.lang.String decode(java.lang.String p)
inVersion
equals 1.0
p
- the string to be decodedpublic static java.lang.String cdata(byte[] chars, java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
in a
xml-cdata sectionchars
- bytes to be encoded and embeddedencoding
- the encoding to be usedjava.io.UnsupportedEncodingException
- when the bytes can not be encoded using encoding
public static boolean isSpecialProperty(java.lang.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 java.lang.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 java.lang.String getPropertyValue(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, java.lang.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 java.lang.String getUpgradePropertyName(java.lang.String name, com.thoughtworks.xstream.converters.UnmarshallingContext context)
NameUpdater
.name
- the original property namecontext
- the unmarshalling contextpublic static java.lang.String getUpgradePropertyValue(java.lang.String name, java.lang.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.