org.databene.commons.converter
Class PrintfConverter
java.lang.Object
org.databene.commons.converter.AbstractConverter<S,T>
org.databene.commons.converter.ThreadSafeConverter<java.lang.Object,java.lang.String>
org.databene.commons.converter.PrintfConverter
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<java.lang.Object,java.lang.String>, ThreadAware
public class PrintfConverter
- extends ThreadSafeConverter<java.lang.Object,java.lang.String>
Converter implementation that uses a Formatter
to render argument objects in C-like printf format.
Created at 20.07.2009 07:18:43
- Since:
- 0.5.0
- Author:
- Volker Bergmann
|
Method Summary |
java.lang.String |
convert(java.lang.Object sourceValue)
Concerts an object of type S to an object of type T |
java.util.Locale |
getLocale()
|
java.lang.String |
getPattern()
|
void |
setLocale(java.util.Locale locale)
|
void |
setPattern(java.lang.String pattern)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrintfConverter
public PrintfConverter()
PrintfConverter
public PrintfConverter(java.lang.String pattern)
PrintfConverter
public PrintfConverter(java.lang.String pattern,
java.util.Locale locale)
getLocale
public java.util.Locale getLocale()
setLocale
public void setLocale(java.util.Locale locale)
getPattern
public java.lang.String getPattern()
setPattern
public void setPattern(java.lang.String pattern)
convert
public java.lang.String convert(java.lang.Object sourceValue)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Parameters:
sourceValue - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
Copyright © 2010. All Rights Reserved.