|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.data.sc.StringConverterSupport
com.ricebridge.data.sc.TypeStringConverter
com.ricebridge.data.sc.TypeArrayStringConverter
Utility class for handling conversion of native Java types in arrays.
| Field Summary | |
protected char |
iEscChar
Escape character for textual values in list. |
protected char |
iSepChar
Separation character for text list of object values. |
protected boolean |
iUseNative
Indicate that native arrays should be used. |
| Fields inherited from class com.ricebridge.data.sc.TypeStringConverter |
iDefault |
| Constructor Summary | |
TypeArrayStringConverter()
|
|
| Method Summary | |
protected abstract Object |
makeArray(List pValues)
Create an array object from the list of values. |
protected Object |
makeDefaultObjectImpl()
Return an empty array. |
protected String |
makeDefaultStringImpl()
Return an empty String. |
protected abstract ArrayList |
makeList(Object pValues)
Convert an object into a List, if possible. |
protected Object |
makeObjectImpl(String pValue,
boolean pUseDefault)
Pass actual object creation to makeTypeObjectImpl method. |
protected String |
makeStringImpl(Object pValues,
boolean pUseDefault)
Pass actual text creation to makeTypeStringImpl method. |
void |
setDelimiters(char pSepChar,
char pEscChar)
Set the delimiters for textual lists. |
void |
setUseNative(boolean pUseNative)
Indicate that native arrays should be used. |
| Methods inherited from class com.ricebridge.data.sc.TypeStringConverter |
getTypeName, makeTypeObjectImpl, makeTypeStringImpl, setDefault |
| Methods inherited from class com.ricebridge.data.sc.StringConverterSupport |
makeDefaultObject, makeDefaultString, makeObject, makeString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean iUseNative
protected char iSepChar
protected char iEscChar
| Constructor Detail |
public TypeArrayStringConverter()
| Method Detail |
public void setUseNative(boolean pUseNative)
When true, assume that the object represented as a String
is a native array type, for example int[].
When false, assume that the object represented as a String
is a wrapper object array type, for example Integer[].
pUseNative - flag to use native arrays
public void setDelimiters(char pSepChar,
char pEscChar)
pSepChar - the separation characterpEscChar - the escape character
protected Object makeObjectImpl(String pValue,
boolean pUseDefault)
throws Exception
makeTypeObjectImpl method.
Create the array from the returned objects.
makeObjectImpl in class TypeStringConverterExceptionprotected Object makeDefaultObjectImpl()
makeDefaultObjectImpl in class TypeStringConverter
protected String makeStringImpl(Object pValues,
boolean pUseDefault)
throws Exception
makeTypeStringImpl method.
Create a textual list using the String values.
makeStringImpl in class TypeStringConverterExceptionprotected String makeDefaultStringImpl()
String.
makeDefaultStringImpl in class TypeStringConverterprotected abstract Object makeArray(List pValues)
If iUseNative is true, then create a native array, else a wrapper object array.
pValues - list of valuesprotected abstract ArrayList makeList(Object pValues)
If iUseNative is true, then assume pValues is a native array, else a wrapper object array.
pValues - object that should be a list
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||