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 locale, DataField data)
          Retrieves the format to use for the given type
static Format<?> getFormat(Class<?> clazz, String locale, KeyValuePairField data)
          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 locale,
                                  DataField data)
                           throws Exception
Retrieves the format to use for the given type

Parameters:
clazz - represents the type of the format (String, Integer, Byte)
locale - optional locale for NumberFormat and DateFormat parsing.
Returns:
Format the formatter
Throws:
IllegalArgumentException - if not suitable formatter is found
Exception

getFormat

public static Format<?> getFormat(Class<?> clazz,
                                  String locale,
                                  KeyValuePairField data)
                           throws Exception
Retrieves the format to use for the given type

Parameters:
clazz - represents the type of the format (String, Integer, Byte)
locale - optional locale for NumberFormat and DateFormat parsing.
Returns:
Format the formatter
Throws:
IllegalArgumentException - if not suitable formatter is found
Exception


Apache Camel