com.devexperts.qd.qtp.text
Class TextCoding

java.lang.Object
  extended by com.devexperts.qd.qtp.text.TextCoding

public class TextCoding
extends java.lang.Object

Utility class that encodes/decodes any strings into special text format.


Field Summary
static java.lang.String BLOCK_TYPE_PREFIX
           
static char COMMENT_SYMBOL
           
static char SEPARATOR
           
static char SPECIAL_SYMBOL
           
 
Constructor Summary
TextCoding()
           
 
Method Summary
static java.lang.String decode(java.lang.String s)
          Converts encoded \uxxxx to unicode chars and changes special saved chars to their original forms.
static java.lang.String encode(java.lang.String s)
          Converts unicodes to encoded \uxxxx and escapes special characters with a preceding slash.
static boolean isNewLine(byte b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
See Also:
Constant Field Values

SPECIAL_SYMBOL

public static final char SPECIAL_SYMBOL
See Also:
Constant Field Values

COMMENT_SYMBOL

public static final char COMMENT_SYMBOL
See Also:
Constant Field Values

BLOCK_TYPE_PREFIX

public static final java.lang.String BLOCK_TYPE_PREFIX
See Also:
Constant Field Values
Constructor Detail

TextCoding

public TextCoding()
Method Detail

encode

public static java.lang.String encode(java.lang.String s)
Converts unicodes to encoded \uxxxx and escapes special characters with a preceding slash.

Parameters:
s - string to convert
Returns:
converted string.

decode

public static java.lang.String decode(java.lang.String s)
                               throws com.devexperts.qd.qtp.text.CorruptedTextFormatException
Converts encoded \uxxxx to unicode chars and changes special saved chars to their original forms.

Parameters:
s - string to convert
Returns:
converted string.
Throws:
CorruptedTextFormatException - if it is impossible to decode s.

isNewLine

public static boolean isNewLine(byte b)