001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.util;
016    
017    import java.util.Calendar;
018    import java.util.Locale;
019    import java.util.TimeZone;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class CalendarFactoryUtil {
025    
026            public static Calendar getCalendar() {
027                    return getCalendarFactory().getCalendar();
028            }
029    
030            public static Calendar getCalendar(int year, int month, int date) {
031                    return getCalendarFactory().getCalendar(year, month, date);
032            }
033    
034            public static Calendar getCalendar(
035                    int year, int month, int date, int hour, int minute) {
036    
037                    return getCalendarFactory().getCalendar(
038                            year, month, date, hour, minute);
039            }
040    
041            public static Calendar getCalendar(
042                    int year, int month, int date, int hour, int minute, int second) {
043    
044                    return getCalendarFactory().getCalendar(
045                            year, month, date, hour, minute, second);
046            }
047    
048            public static Calendar getCalendar(Locale locale) {
049                    return getCalendarFactory().getCalendar(locale);
050            }
051    
052            public static Calendar getCalendar(TimeZone timeZone) {
053                    return getCalendarFactory().getCalendar(timeZone);
054            }
055    
056            public static Calendar getCalendar(TimeZone timeZone, Locale locale) {
057                    return getCalendarFactory().getCalendar(timeZone, locale);
058            }
059    
060            public static CalendarFactory getCalendarFactory() {
061                    return _calendarFactory;
062            }
063    
064            public void setCalendarFactory(CalendarFactory calendarFactory) {
065                    _calendarFactory = calendarFactory;
066            }
067    
068            private static CalendarFactory _calendarFactory;
069    
070    }