|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.util.DefaultTypeConverter
public class DefaultTypeConverter
Name: DefaultTypeConverter
Description: The default type converter implementation.
Constructor Summary | |
---|---|
DefaultTypeConverter()
Constructs a DefaultTypeConverter instance with no specific attributes. |
|
DefaultTypeConverter(FormatHelper formatHelper)
Constructs a DefaultTypeConverter instance with specific attributes. |
Method Summary | |
---|---|
Object |
convertObject(Class clazz,
Object value)
Converts the given value into an instance of this type. |
Object |
convertObject(int typeId,
Object value)
Converts the given value into an instance of this type. |
String |
formatValue(Class clazz,
Object value)
FormatsConverts the given value into an instance of this type. |
String |
formatValue(int typeId,
Object value)
FormatsConverts the given value into an instance of this type. |
DataType |
getDataType(Class clazz)
Gets the data type for the given class. |
DataType |
getDataType(int typeId)
Gets the data type for the given type ID. |
void |
registerDataType(Class clazz,
DataType typeHandler)
Registers the data type. |
protected void |
registerDataTypes()
Registers the data types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTypeConverter()
public DefaultTypeConverter(FormatHelper formatHelper)
formatHelper
- The format helper to use.Method Detail |
---|
protected void registerDataTypes()
public void registerDataType(Class clazz, DataType typeHandler)
registerDataType
in interface TypeConverter
clazz
- The type to handle.typeHandler
- The type handler.public DataType getDataType(Class clazz)
getDataType
in interface TypeConverter
clazz
- The type to get the handler for.
public DataType getDataType(int typeId)
getDataType
in interface TypeConverter
typeId
- The ID of the type to get the handler for.
public Object convertObject(Class clazz, Object value) throws TypeConverterException
convertObject
in interface TypeConverter
clazz
- The type class.value
- The value to convert.
TypeConverterException
- In case the conversion failed.public Object convertObject(int typeId, Object value) throws TypeConverterException
convertObject
in interface TypeConverter
typeId
- The type ID.value
- The value to convert.
TypeConverterException
- In case the conversion failed.public String formatValue(Class clazz, Object value) throws TypeConverterException
formatValue
in interface TypeConverter
clazz
- The type class.value
- The value to convert.
TypeConverterException
- In case the conversion failed.public String formatValue(int typeId, Object value) throws TypeConverterException
formatValue
in interface TypeConverter
typeId
- The type ID.value
- The value to convert.
TypeConverterException
- In case the conversion failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |