T
- the type in which the provided value has to be converted@Role public interface Converter<T>
ConverterManager
and BeanManager
package to manage the conversion of objects from one type to
another.
The type supported by the converted is indicated in its role.
For example:
@Component public class IntegerConverter implements Converter<java.lang.Integer>
If a conversion cannot be performed successfully the converter is expected to throw a
ConversionException
.
Modifier and Type | Method and Description |
---|---|
<G> G |
convert(Type targetType,
Object sourceValue)
Convert the specified input object into an output object of the specified type.
|
<G> G convert(Type targetType, Object sourceValue)
G
- 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 convertConversionException
- if conversion cannot be performed successfullyCopyright © 2004–2021 XWiki. All rights reserved.