org.apache.commons.convert.conversion
Class ObjectToStringConversionFactory
java.lang.Object
org.apache.commons.convert.conversion.AbstractConversionFactory
org.apache.commons.convert.conversion.ObjectToStringConversionFactory
- All Implemented Interfaces:
- ConversionFactory
public class ObjectToStringConversionFactory
- extends AbstractConversionFactory
Conversion from Object to String using toString()
.
- Since:
- 1.0
- Version:
- $Id: ObjectToStringConversionFactory.java 155441 2005-02-26 13:19:22Z dirkv $
- Author:
- Stephen Colebourne
Method Summary |
protected Object |
convertValue(Object value,
Converter converter)
Convert the specified input object into an output object
of the another type. |
protected int |
getMatchPercent()
Returns a low match percent to allow other conversions to replace this one. |
INSTANCE
public static final ConversionFactory INSTANCE
- Singleton instance of this factory
ObjectToStringConversionFactory
protected ObjectToStringConversionFactory()
- Restricted constructor.
getMatchPercent
protected int getMatchPercent()
- Returns a low match percent to allow other conversions to replace this one.
- Overrides:
getMatchPercent
in class AbstractConversionFactory
- Returns:
- 20
convertValue
protected Object convertValue(Object value,
Converter converter)
- Convert the specified input object into an output object
of the another type.
- Specified by:
convertValue
in class AbstractConversionFactory
- Parameters:
value
- the input value to be converted, pre-checked to not be nullconverter
- the converter being used, not null
- Returns:
- the converted value
Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.