1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 }