org.databene.commons.converter
Class ParseFormatConverter<T>

java.lang.Object
  extended by org.databene.commons.converter.AbstractConverter<S,T>
      extended by org.databene.commons.converter.FormatBasedConverter<java.lang.String,T>
          extended by org.databene.commons.converter.ParseFormatConverter<T>
All Implemented Interfaces:
java.lang.Cloneable, Converter<java.lang.String,T>, ThreadAware

public class ParseFormatConverter<T>
extends FormatBasedConverter<java.lang.String,T>

Converts a String to an object by using a java.lang.Format object's format() method.

Created: 30.08.2006 19:48:09

Since:
0.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.commons.converter.FormatBasedConverter
format
 
Fields inherited from class org.databene.commons.converter.AbstractConverter
sourceType, targetType
 
Constructor Summary
ParseFormatConverter(java.lang.Class<T> targetType, java.text.Format format, boolean threadSafe)
           
 
Method Summary
 T convert(java.lang.String source)
          Converts an object to a String by using the format's format() method.
 
Methods inherited from class org.databene.commons.converter.FormatBasedConverter
clone, isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.commons.converter.AbstractConverter
getSourceType, getTargetType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseFormatConverter

public ParseFormatConverter(java.lang.Class<T> targetType,
                            java.text.Format format,
                            boolean threadSafe)
Method Detail

convert

public T convert(java.lang.String source)
          throws ConversionException
Converts an object to a String by using the format's format() method.

Parameters:
source - the object to convert
Returns:
the converted object
Throws:
ConversionException - if the conversion fails


Copyright © 2010. All Rights Reserved.