org.apache.commons.betwixt.strategy
Class ConvertUtilsObjectStringConverter

java.lang.Object
  extended by org.apache.commons.betwixt.strategy.ObjectStringConverter
      extended by org.apache.commons.betwixt.strategy.ConvertUtilsObjectStringConverter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultObjectStringConverter

public class ConvertUtilsObjectStringConverter
extends ObjectStringConverter

String <-> object conversion strategy that delegates to ConvertUtils.

Since:
0.5
Author:
Robert Burrell Donkin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.commons.betwixt.strategy.ObjectStringConverter
FLAVOUR_OPTION_NAME
 
Constructor Summary
ConvertUtilsObjectStringConverter()
           
 
Method Summary
 java.lang.String objectToString(java.lang.Object object, java.lang.Class type, java.lang.String flavour, Context context)
          Converts an object to a string representation using ConvertUtils.
 java.lang.Object stringToObject(java.lang.String value, java.lang.Class type, java.lang.String flavour, Context context)
          Converts an object to a string representation using ConvertUtils.
 
Methods inherited from class org.apache.commons.betwixt.strategy.ObjectStringConverter
objectToString, stringToObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertUtilsObjectStringConverter

public ConvertUtilsObjectStringConverter()
Method Detail

objectToString

public java.lang.String objectToString(java.lang.Object object,
                                       java.lang.Class type,
                                       java.lang.String flavour,
                                       Context context)
Converts an object to a string representation using ConvertUtils.

Overrides:
objectToString in class ObjectStringConverter
Parameters:
object - the object to be converted, possibly null
type - the property class of the object, not null
flavour - a string allow symantic differences in formatting to be communicated (ignored)
context - not null
Returns:
a String representation, not null

stringToObject

public java.lang.Object stringToObject(java.lang.String value,
                                       java.lang.Class type,
                                       java.lang.String flavour,
                                       Context context)
Converts an object to a string representation using ConvertUtils. This implementation ignores null and empty string values (rather than converting them).

Overrides:
stringToObject in class ObjectStringConverter
Parameters:
value - the String to be converted, not null
type - the property class to be returned (if possible), not null
flavour - a string allow symantic differences in formatting to be communicated (ignored)
context - not null
Returns:
an Object converted from the String, not null


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.