Package org.eclipse.birt.core.format
Class DateFormatter
java.lang.Object
org.eclipse.birt.core.format.DateFormatter
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.birt.core.format.IFormatter
IFormatter.DefaultFormatter -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionconstuctor method with no paremeterDateFormatter(com.ibm.icu.util.TimeZone timeZone) DateFormatter(com.ibm.icu.util.ULocale localeLoc) constuctor method with Locale parametersDateFormatter(com.ibm.icu.util.ULocale localeLoc, com.ibm.icu.util.TimeZone timeZone) DateFormatter(String pattern) constuctor method with String parameterDateFormatter(String pattern, com.ibm.icu.util.ULocale localeLoc) constuctor method with two parameters, one is String type while the other is Locale typeDateFormatter(String pattern, com.ibm.icu.util.ULocale localeLoc, com.ibm.icu.util.TimeZone timeZone) DateFormatter(String pattern, Locale localeLoc) Deprecated.since 2.1DateFormatter(Locale localeLoc) Deprecated.since 2.1 -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPattern(String formatString) formatValue(Object value) format the value object into a string.Returns format code according to format type and current localecom.ibm.icu.text.SimpleDateFormatReturns format code according to format type and current localeReturns format code according to format type and current localeget the string patternParses the input string into a formatted date type.
-
Field Details
-
DATETIME_UNFORMATTED
- See Also:
-
DATE_UNFORMATTED
- See Also:
-
TIME_UNFORMATTED
- See Also:
-
logger
logger used to log syntax errors.
-
-
Constructor Details
-
DateFormatter
public DateFormatter()constuctor method with no paremeter -
DateFormatter
public DateFormatter(com.ibm.icu.util.TimeZone timeZone) -
DateFormatter
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.since 2.1 -
DateFormatter
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.since 2.1
-
-
Method Details
-
getPattern
get the string pattern- Returns:
-
applyPattern
-
format
-
getFormatCode
Returns format code according to format type and current locale -
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
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
Description copied from interface:IFormatterformat the value object into a string.- Specified by:
formatValuein interfaceIFormatter- Returns:
-