ewe.util
Class TextEncoder

java.lang.Object
  extended byewe.util.TextEncoder

public class TextEncoder
extends Object


Field Summary
 char[] buffer
           
 int cur
           
 int entries
           
static String hex
           
static String[] textables
           
 
Constructor Summary
TextEncoder()
           
 
Method Summary
protected  void addValue(String name, char[] value, int start, int length)
           
 void addValue(String name, String value)
           
static Object arrayFromText(String txt, Class requestor)
           
 void clear()
           
static double doubleFromText(char[] from, int offset)
           
protected  int expand()
           
static void fromString(Field f, Object o, String val)
           
static void fromString(Object obj, String val)
           
static void fromString(Object obj, String val, Class requestor)
           
static Object getFullObject(String typeAndData, Class requestor)
           
static Object getObject(String type, String encoded, Class requestor)
           
static long longFromText(int numBytes, char[] from, int offset)
           
static void saveFullObject(Object obj, TextEncoder te)
          This returns an encoded string as:
 String toString()
          Return a String representation of this object.
static String toString(Field f, Object o)
           
static String toString(Object obj)
           
 SubString toSubString(SubString dest)
           
static char[] toText(double value, char[] dest, int offset)
           
static char[] toText(long value, int numBytes, char[] dest, int offset)
           
static String toText(String typeName, Object value)
           
static String toText(Wrapper value)
           
static Wrapper toWrapper(String typeName, String actualClass, char[] from, int offset, int length, Class requestor)
           
static Wrapper toWrapper(String typeName, String actualClass, String from, Class requestor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

buffer

public char[] buffer

cur

public int cur

entries

public int entries

hex

public static final String hex
See Also:
Constant Field Values

textables

public static String[] textables
Constructor Detail

TextEncoder

public TextEncoder()
Method Detail

clear

public void clear()

expand

protected int expand()

addValue

protected void addValue(String name,
                        char[] value,
                        int start,
                        int length)

addValue

public void addValue(String name,
                     String value)

toSubString

public SubString toSubString(SubString dest)

toString

public String toString()
Description copied from class: Object
Return a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representing this object.

getObject

public static Object getObject(String type,
                               String encoded,
                               Class requestor)

arrayFromText

public static Object arrayFromText(String txt,
                                   Class requestor)

saveFullObject

public static void saveFullObject(Object obj,
                                  TextEncoder te)
This returns an encoded string as:

=

If the object is null then just "=" will be encoded.

If the class is a string then className will be empty EXCEPT if the String is empty, in which case the className will be "java/lang/String";


getFullObject

public static Object getFullObject(String typeAndData,
                                   Class requestor)

toString

public static String toString(Object obj)

toString

public static String toString(Field f,
                              Object o)

fromString

public static void fromString(Object obj,
                              String val)

fromString

public static void fromString(Object obj,
                              String val,
                              Class requestor)

fromString

public static void fromString(Field f,
                              Object o,
                              String val)

toText

public static char[] toText(long value,
                            int numBytes,
                            char[] dest,
                            int offset)

toText

public static char[] toText(double value,
                            char[] dest,
                            int offset)

longFromText

public static long longFromText(int numBytes,
                                char[] from,
                                int offset)

doubleFromText

public static double doubleFromText(char[] from,
                                    int offset)

toText

public static String toText(String typeName,
                            Object value)

toWrapper

public static Wrapper toWrapper(String typeName,
                                String actualClass,
                                String from,
                                Class requestor)

toWrapper

public static Wrapper toWrapper(String typeName,
                                String actualClass,
                                char[] from,
                                int offset,
                                int length,
                                Class requestor)

toText

public static String toText(Wrapper value)