org.xwiki.properties.internal.converter
Class EnumConverter

java.lang.Object
  extended by org.xwiki.properties.converter.AbstractConverter
      extended by org.xwiki.properties.internal.converter.EnumConverter
All Implemented Interfaces:
Converter

@Component
@Named(value="enum")
@Singleton
public class EnumConverter
extends AbstractConverter

Bean Utils converter that converts a value into an enumeration class value.

Since:
2.0M2
Version:
$Id$

Constructor Summary
EnumConverter()
           
 
Method Summary
protected
<T> T
convertToType(Type type, Object value)
          Convert the input object into an output object of the specified type.
 
Methods inherited from class org.xwiki.properties.converter.AbstractConverter
convert, convertToString, convertToType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumConverter

public EnumConverter()
Method Detail

convertToType

protected <T> T convertToType(Type type,
                              Object value)
Convert the input object into an output object of the specified type.

Typical implementations will provide a minimum of String --> type conversion.

Overrides:
convertToType in class AbstractConverter
Type Parameters:
T - the type in which the provided value has o be converted
Parameters:
type - Data type to which this value should be converted.
value - The input value to be converted.
Returns:
The converted value.
See Also:
org.apache.commons.beanutils.converters.AbstractConverter#convertToType(java.lang.Class, java.lang.Object)


Copyright © 2004-2011 XWiki. All Rights Reserved.