|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.util.DataTypes
This class provides definition, conversion, and simple parsing for known data types.
Field Summary | |
static int |
TYPE_BIGDECIMAL
|
static int |
TYPE_BOOLEAN
|
static int |
TYPE_BYTE
|
static int |
TYPE_DATE
|
static int |
TYPE_DOUBLE
|
static int |
TYPE_FLOAT
|
static int |
TYPE_INT
|
static int |
TYPE_LONG
|
static int |
TYPE_SHORT
|
static int |
TYPE_SQL_DATE
|
static int |
TYPE_STRING
|
static int |
TYPE_TIME
|
static int |
TYPE_TIMESTAMP
|
static int |
TYPE_UNDEFINED
|
Method Summary | |
static void |
checkJavaDataType(int i)
Checks given index to ensure it is valid type otherwise throws UnsupportedDataTypeException. |
static java.lang.Object |
convert(int javaDataType,
java.lang.Object value)
Returns an object of the type indicated by javaDataType set from the value of the given object. |
static java.lang.String |
format(int javaDataType,
java.lang.Object value)
Returns a default formatted String for the given object. |
static java.lang.Class |
getClassForType(int javaDatType)
Returns the Class for the given Java data type. |
static int |
getDataType(java.lang.String className)
Returns an int id for the given data type or TYPE_UNDEFINED if unknown. |
static java.text.DateFormat |
getDefaultDateFormat()
Get the default DataFormat used by the parse/format routines. |
static java.lang.String |
getJavaNameForType(int javaDatType)
Returns the class name for the given Java data type. |
static java.lang.Object |
parse(int javaDataType,
java.lang.String value)
Returns a new object of type indicated by javaDataType with parsed given value. |
static void |
setDefaultDateFormat(java.text.DateFormat dfNew)
Set the default DataFormat used by the parse/format routines. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_UNDEFINED
public static final int TYPE_STRING
public static final int TYPE_BIGDECIMAL
public static final int TYPE_TIMESTAMP
public static final int TYPE_BOOLEAN
public static final int TYPE_INT
public static final int TYPE_BYTE
public static final int TYPE_SHORT
public static final int TYPE_LONG
public static final int TYPE_FLOAT
public static final int TYPE_DATE
public static final int TYPE_TIME
public static final int TYPE_DOUBLE
public static final int TYPE_SQL_DATE
Method Detail |
public static java.text.DateFormat getDefaultDateFormat()
public static void setDefaultDateFormat(java.text.DateFormat dfNew)
dfNew
- the default DataFormat used by the parse/format routinespublic static java.lang.String getJavaNameForType(int javaDatType) throws UnsupportedDataTypeException
UnsupportedDataTypeException
- if the given value is not a known type.public static java.lang.Class getClassForType(int javaDatType) throws UnsupportedDataTypeException
UnsupportedDataTypeException
- if the given value is not a known type.public static void checkJavaDataType(int i) throws UnsupportedDataTypeException
UnsupportedDataTypeException
public static int getDataType(java.lang.String className)
public static java.lang.Object convert(int javaDataType, java.lang.Object value) throws UnsupportedConversionException, UnsupportedDataTypeException
UnsupportedConversionException
UnsupportedDataTypeException
public static java.lang.Object parse(int javaDataType, java.lang.String value) throws java.text.ParseException, UnsupportedDataTypeException
javaDataType
- indicates data type of value (see TYPE_xxx constants).
UnsupportedDataTypeException
- if unknown javaDataType given.
java.text.ParseException
- if given value cannot be parsed.public static java.lang.String format(int javaDataType, java.lang.Object value) throws UnsupportedDataTypeException
TYPE_UNDEFINED
, the toString()
method is used.
javaDataType
- indicates data type of value (see TYPE_xxx constants).value
- is the object to format as a String
UnsupportedDataTypeException
- if unknown javaDataType given.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |