org.pfsw.text
Class DefaultStringConverter<T>

java.lang.Object
  extended by org.pfsw.text.DefaultStringConverter<T>
All Implemented Interfaces:
org.pfsw.bif.conversion.IObjectConverter<T,java.lang.String>, org.pfsw.bif.conversion.IStringConverter<T>

public class DefaultStringConverter<T>
extends java.lang.Object
implements org.pfsw.bif.conversion.IStringConverter<T>

Default string converter for any object. It uses method asString() if the object is an IStringRepresentation, otherwise toString().


Constructor Summary
DefaultStringConverter()
           
 
Method Summary
 java.lang.String convert(T object)
          Returns the string representation of the given object.
static
<V> DefaultStringConverter<V>
create()
          Returns a new instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStringConverter

public DefaultStringConverter()
Method Detail

create

public static <V> DefaultStringConverter<V> create()
Returns a new instance of this class.


convert

public java.lang.String convert(T object)
Returns the string representation of the given object. It uses method asString() if the object is an IStringRepresentation, otherwise toString(). A null input will return null, too.

Specified by:
convert in interface org.pfsw.bif.conversion.IObjectConverter<T,java.lang.String>
Specified by:
convert in interface org.pfsw.bif.conversion.IStringConverter<T>