org.apache.commons.convert.conversion
Class ObjectToStringConversionFactory

java.lang.Object
  extended by org.apache.commons.convert.conversion.AbstractConversionFactory
      extended by 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

Field Summary
static ConversionFactory INSTANCE
          Singleton instance of this factory
 
Fields inherited from class org.apache.commons.convert.conversion.AbstractConversionFactory
STRING_CLASS
 
Constructor Summary
protected ObjectToStringConversionFactory()
          Restricted constructor.
 
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.
 
Methods inherited from class org.apache.commons.convert.conversion.AbstractConversionFactory
getBaseFromType, getInstance, getMatchPercent, getToType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final ConversionFactory INSTANCE
Singleton instance of this factory

Constructor Detail

ObjectToStringConversionFactory

protected ObjectToStringConversionFactory()
Restricted constructor.

Method Detail

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 null
converter - the converter being used, not null
Returns:
the converted value


Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.