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 Details

    • NumberPatternFormat

      protected NumberPatternFormat()
    • NumberPatternFormat

      protected NumberPatternFormat(String pattern, Locale locale)
    • NumberPatternFormat

      protected NumberPatternFormat(String pattern, Locale locale, int precision, String rounding, String decimalSeparator, String groupingSeparator)
  • Method Details

    • format

      public String format(T object) throws Exception
      Description copied from interface: Format
      Formats the object into a String
      Specified by:
      format in interface Format<T>
      Parameters:
      object - the object
      Returns:
      formatted as a String
      Throws:
      Exception - can be thrown
    • parse

      public abstract T parse(String string) throws Exception
      Description copied from interface: Format
      Parses a String into an object
      Specified by:
      parse in interface Format<T>
      Parameters:
      string - the string
      Returns:
      T the object
      Throws:
      Exception - can be thrown
    • 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: PatternFormat
      Method used to retrieve the pattern for the format
      Specified by:
      getPattern in interface PatternFormat<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)