org.apache.camel.dataformat.bindy
Class FormatFactory

java.lang.Object
  extended by org.apache.camel.dataformat.bindy.FormatFactory

public final class FormatFactory
extends Object

Factory to return Format classes for a given type.


Method Summary
static Format<?> getFormat(Class<?> clazz, String pattern, String locale, int precision)
          Retrieves the format to use for the given type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 data
locale - 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