1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.util;
16  
17  import java.text.Format;
18  
19  import java.util.Locale;
20  import java.util.TimeZone;
21  
22  /**
23   * <a href="FastDateFormatFactoryUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class FastDateFormatFactoryUtil {
28  
29      public static Format getDate(Locale locale) {
30          return getFastDateFormatFactory().getDate(locale);
31      }
32  
33      public static Format getDate(Locale locale, TimeZone timeZone) {
34          return getFastDateFormatFactory().getDate(locale, timeZone);
35      }
36  
37      public static Format getDate(TimeZone timeZone) {
38          return getFastDateFormatFactory().getDate(timeZone);
39      }
40  
41      public static Format getDateTime(Locale locale) {
42          return getFastDateFormatFactory().getDateTime(locale);
43      }
44  
45      public static Format getDateTime(Locale locale, TimeZone timeZone) {
46          return getFastDateFormatFactory().getDateTime(locale, timeZone);
47      }
48  
49      public static Format getDateTime(TimeZone timeZone) {
50          return getFastDateFormatFactory().getDateTime(timeZone);
51      }
52  
53      public static FastDateFormatFactory getFastDateFormatFactory() {
54          return _fastDateFormatFactory;
55      }
56  
57      public static Format getSimpleDateFormat(String pattern) {
58          return getFastDateFormatFactory().getSimpleDateFormat(pattern);
59      }
60  
61      public static Format getSimpleDateFormat(
62          String pattern, Locale locale) {
63  
64          return getFastDateFormatFactory().getSimpleDateFormat(pattern, locale);
65      }
66  
67      public static Format getSimpleDateFormat(
68          String pattern, Locale locale, TimeZone timeZone) {
69  
70          return getFastDateFormatFactory().getSimpleDateFormat(
71              pattern, locale, timeZone);
72      }
73  
74      public static Format getSimpleDateFormat(
75          String pattern, TimeZone timeZone) {
76  
77          return getFastDateFormatFactory().getSimpleDateFormat(
78              pattern, timeZone);
79      }
80  
81      public static Format getTime(Locale locale) {
82          return getFastDateFormatFactory().getTime(locale);
83      }
84  
85      public static Format getTime(Locale locale, TimeZone timeZone) {
86          return getFastDateFormatFactory().getTime(locale, timeZone);
87      }
88  
89      public static Format getTime(TimeZone timeZone) {
90          return getFastDateFormatFactory().getTime(timeZone);
91      }
92  
93      public void setFastDateFormatFactory(
94          FastDateFormatFactory fastDateFormatFactory) {
95  
96          _fastDateFormatFactory = fastDateFormatFactory;
97      }
98  
99      private static FastDateFormatFactory _fastDateFormatFactory;
100 
101 }