001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }