Class NumberPatternFormat<T>
- java.lang.Object
-
- org.apache.camel.dataformat.bindy.format.NumberPatternFormat<T>
-
- All Implemented Interfaces:
Format<T>,PatternFormat<T>
public abstract class NumberPatternFormat<T> extends Object implements PatternFormat<T>
-
-
Constructor Summary
Constructors Constructor Description NumberPatternFormat()NumberPatternFormat(String pattern, Locale locale)NumberPatternFormat(String pattern, Locale locale, int precision, String rounding, String decimalSeparator, String groupingSeparator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stringformat(T object)Formats the object into a StringLocalegetLocale()protected NumberFormatgetNumberFormat()Gets the number format if in use.StringgetPattern()Method used to retrieve the pattern for the formatintgetPrecision()StringgetRounding()abstract Tparse(String string)Parses a String into an objectvoidsetLocale(Locale locale)voidsetPattern(String pattern)voidsetPrecision(int precision)voidsetRounding(String rounding)
-
-
-
Method Detail
-
format
public String format(T object) throws Exception
Description copied from interface:FormatFormats the object into a String
-
parse
public abstract T parse(String string) throws Exception
Description copied from interface:FormatParses a String into an object
-
getNumberFormat
protected NumberFormat getNumberFormat()
Gets the number format if in use.- Returns:
- the number format, or null if not in use
-
getPattern
public String getPattern()
Description copied from interface:PatternFormatMethod used to retrieve the pattern for the format- Specified by:
getPatternin interfacePatternFormat<T>- Returns:
- String the pattern
-
setPattern
public void setPattern(String pattern)
-
getPrecision
public int getPrecision()
-
setPrecision
public void setPrecision(int precision)
-
getRounding
public String getRounding()
-
setRounding
public void setRounding(String rounding)
-
getLocale
public Locale getLocale()
-
setLocale
public void setLocale(Locale locale)
-
-