Class DateFormatter

java.lang.Object
org.eclipse.birt.core.format.DateFormatter
All Implemented Interfaces:
IFormatter

public class DateFormatter extends Object implements IFormatter
DateFormatter. Design for Class DateFormatter.This version is for open source, so we only apply the function which Java has provided. Beside these basic function, in this version, we also provide some new API for further implementation in the future
  • Field Details

  • Constructor Details

    • DateFormatter

      public DateFormatter()
      constuctor method with no paremeter
    • DateFormatter

      public DateFormatter(com.ibm.icu.util.TimeZone timeZone)
    • DateFormatter

      public DateFormatter(String pattern)
      constuctor method with String parameter
      Parameters:
      pattern -
    • DateFormatter

      public DateFormatter(com.ibm.icu.util.ULocale localeLoc)
      constuctor method with Locale parameters
      Parameters:
      localeLoc -
    • DateFormatter

      public DateFormatter(com.ibm.icu.util.ULocale localeLoc, com.ibm.icu.util.TimeZone timeZone)
    • DateFormatter

      @Deprecated public DateFormatter(Locale localeLoc)
      Deprecated.
      since 2.1
    • DateFormatter

      public DateFormatter(String pattern, com.ibm.icu.util.ULocale localeLoc)
      constuctor method with two parameters, one is String type while the other is Locale type
      Parameters:
      pattern -
      localeLoc -
    • DateFormatter

      public DateFormatter(String pattern, com.ibm.icu.util.ULocale localeLoc, com.ibm.icu.util.TimeZone timeZone)
    • DateFormatter

      @Deprecated public DateFormatter(String pattern, Locale localeLoc)
      Deprecated.
      since 2.1
  • Method Details

    • getPattern

      public String getPattern()
      get the string pattern
      Returns:
    • applyPattern

      public void applyPattern(String formatString)
    • format

      public String format(Date date)
    • getFormatCode

      public String getFormatCode()
      Returns format code according to format type and current locale
    • getLocalizedFormatCode

      public String getLocalizedFormatCode()
      Returns format code according to format type and current locale
    • getFormatter

      public com.ibm.icu.text.SimpleDateFormat getFormatter()
      Returns format code according to format type and current locale
    • parse

      public Date parse(String date) throws ParseException
      Parses the input string into a formatted date type.
      Parameters:
      date - the input string to parse
      Returns:
      the formatted date
      Throws:
      ParseException - if the beginning of the specified string cannot be parsed.
    • formatValue

      public String formatValue(Object value)
      Description copied from interface: IFormatter
      format the value object into a string.
      Specified by:
      formatValue in interface IFormatter
      Returns: