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, 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,
                                  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 formating of the data
precision - optional scale for BigDecimal parsing.
Returns:
Format the formatter
Throws:
IllegalArgumentException - if not suitable formatter is found
Exception


Copyright © 2007-2009 The Apache Software Foundation. All Rights Reserved.