public class TextEncoder extends Object
Modifier and Type | Field and Description |
---|---|
char[] |
buffer |
int |
cur |
int |
entries |
static String |
hex |
static Class[] |
textables |
static boolean |
useVersion1 |
Constructor and Description |
---|
TextEncoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
addValue(String name,
char[] value,
int start,
int length) |
void |
addValue(String name,
String value) |
void |
addValues(Map map)
Add all keys and values.
|
void |
addValues(PropertyList pl)
Add all keys and values.
|
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,
Wrapper toUse) |
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,
Wrapper toUse) |
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) |
public char[] buffer
public int cur
public int entries
public static final String hex
public static boolean useVersion1
public static Class[] textables
public void clear()
protected int expand()
public void addValues(Map map)
map
- the full collection to be added.public void addValues(PropertyList pl)
pl
- the full collection to be added.protected void addValue(String name, char[] value, int start, int length)
public String toString()
Object
public static void saveFullObject(Object obj, TextEncoder te)
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";
public static char[] toText(long value, int numBytes, char[] dest, int offset)
public static char[] toText(double value, char[] dest, int offset)
public static long longFromText(int numBytes, char[] from, int offset)
public static double doubleFromText(char[] from, int offset)