org.xwiki.properties.converter
Interface Converter

All Known Implementing Classes:
AbstractCollectionConverter, AbstractConverter

@ComponentRole
public interface Converter

Converter provided value in the provided target type.

The role of this component is supposed to be the supported target types. For example:

 @Component("java.lang.Integer")
 public class IntegerConverter implements Converter
 

When something goes wrong a Converter can throw a ConversionException.

Since:
2.0M2
Version:
$Id: Converter.java 33729 2010-12-29 13:14:04Z tmortagne $

Method Summary
<T> T
convert(java.lang.reflect.Type targetType, java.lang.Object sourceValue)
           
 

Method Detail

convert

<T> T convert(java.lang.reflect.Type targetType,
              java.lang.Object sourceValue)
Type Parameters:
T - the type in which the provided value has to be converted
Parameters:
targetType - the type in which the provided value has to be converted
sourceValue - the value to convert
Returns:
the converted value
Since:
3.0M1


Copyright © 2004-2011 XWiki. All Rights Reserved.