|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.properties.converter.AbstractConverter
public abstract class AbstractConverter
Helper base class for a Converter component.
Commonly a new component is supposed to implements convertToString(Object) and
convertToType(Class, Object).
| Constructor Summary | |
|---|---|
AbstractConverter()
|
|
| Method Summary | ||
|---|---|---|
|
convert(java.lang.reflect.Type targetType,
java.lang.Object sourceValue)
|
|
protected java.lang.String |
convertToString(java.lang.Object value)
Convert the input object into a String. |
|
protected
|
convertToType(java.lang.Class<T> type,
java.lang.Object value)
Deprecated. since 3.0M1 overwrite convertToType(Type, Object) instead |
|
protected
|
convertToType(java.lang.reflect.Type targetType,
java.lang.Object value)
Convert the input object into an output object of the specified type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractConverter()
| Method Detail |
|---|
public <T> T convert(java.lang.reflect.Type targetType,
java.lang.Object sourceValue)
convert in interface ConverterT - the type in which the provided value has to be convertedtargetType - the type in which the provided value has to be convertedsourceValue - the value to convert
Converter.convert(java.lang.reflect.Type, java.lang.Object)protected java.lang.String convertToString(java.lang.Object value)
N.B.This implementation simply uses the value's toString() method and should be overriden if
a more sophisticated mechanism for conversion to a String is required.
value - The input value to be converted.
protected <T> T convertToType(java.lang.reflect.Type targetType,
java.lang.Object value)
Typical implementations will provide a minimum of String --> type conversion.
T - the type in which the provided value has o be convertedtargetType - Data type to which this value should be converted.value - The input value to be converted.
@Deprecated
protected <T> T convertToType(java.lang.Class<T> type,
java.lang.Object value)
convertToType(Type, Object) instead
Typical implementations will provide a minimum of String --> type conversion.
T - the type in which the provided value has o be convertedtype - Data type to which this value should be converted.value - The input value to be converted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||