org.apache.camel.dataformat.bindy
Class FormatFactory
java.lang.Object
org.apache.camel.dataformat.bindy.FormatFactory
public final class FormatFactory
- extends Object
Factory to return Format
classes for a given type.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getFormat
public static Format<?> getFormat(Class<?> clazz,
String pattern,
String locale,
int precision)
throws Exception
- Retrieves the format to use for the given type
- Parameters:
clazz
- represents the type of the format (String, Integer, Byte)pattern
- is the pattern to be used during the formatting of the datalocale
- optional locale for NumberFormat and DateFormat parsing.precision
- optional scale for BigDecimal parsing.
- Returns:
- Format the formatter
- Throws:
IllegalArgumentException
- if not suitable formatter is found
Exception
Apache CAMEL