1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.plugin.jodatime

File JodaTimePluginApi.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

0
17
17
1
190
84
17
1
1
17
1

Classes

Class Line # Actions
JodaTimePluginApi 36 17 0% 17 34
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20   
21    package com.xpn.xwiki.plugin.jodatime;
22   
23    import org.joda.time.DateTime;
24    import org.joda.time.DateTimeZone;
25    import org.joda.time.Duration;
26    import org.joda.time.MutableDateTime;
27    import org.joda.time.ReadableInstant;
28    import org.joda.time.format.DateTimeFormatter;
29   
30    import com.xpn.xwiki.XWikiContext;
31    import com.xpn.xwiki.plugin.PluginApi;
32   
33    /**
34    * Api for the JodaTimePlugin
35    */
 
36    public class JodaTimePluginApi extends PluginApi<JodaTimePlugin>
37    {
 
38  0 toggle public JodaTimePluginApi(JodaTimePlugin plugin, XWikiContext context)
39    {
40  0 super(plugin, context);
41    }
42   
43    /**
44    * @see org.joda.time.DateTime#DateTime()
45    * @see JodaTimePlugin#getDateTime()
46    */
 
47  0 toggle public DateTime getDateTime()
48    {
49  0 return getProtectedPlugin().getDateTime();
50    }
51   
52    /**
53    * @see org.joda.time.DateTime#DateTime(int, int, int, int, int, int, int)
54    * @see JodaTimePlugin#getDateTime(int, int, int, int, int, int, int)
55    */
 
56  0 toggle public DateTime getDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour,
57    int secondOfMinute, int millisOfSecond)
58    {
59  0 return getProtectedPlugin().getDateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute,
60    millisOfSecond);
61    }
62   
63    /**
64    * @see org.joda.time.DateTime#DateTime(long)
65    * @see JodaTimePlugin#getDateTime(long)
66    */
 
67  0 toggle public DateTime getDateTime(long instant)
68    {
69  0 return getProtectedPlugin().getDateTime(instant);
70    }
71   
72    /**
73    * @see org.joda.time.MutableDateTime#MutableDateTime()
74    * @see JodaTimePlugin#getMutableDateTime()
75    */
 
76  0 toggle public MutableDateTime getMutableDateTime()
77    {
78  0 return getProtectedPlugin().getMutableDateTime();
79    }
80   
81    /**
82    * @see org.joda.time.MutableDateTime#MutableDateTime(int, int, int, int, int, int, int)
83    * @see JodaTimePlugin#getMutableDateTime(int, int, int, int, int, int, int)
84    */
 
85  0 toggle public MutableDateTime getMutableDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay,
86    int minuteOfHour, int secondOfMinute, int millisOfSecond)
87    {
88  0 return getProtectedPlugin().getMutableDateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour,
89    secondOfMinute, millisOfSecond);
90    }
91   
92    /**
93    * @see org.joda.time.MutableDateTime#MutableDateTime(long)
94    * @see JodaTimePlugin#getMutableDateTime(long)
95    */
 
96  0 toggle public MutableDateTime getMutableDateTime(long instant)
97    {
98  0 return getProtectedPlugin().getMutableDateTime(instant);
99    }
100   
101    /**
102    * @see org.joda.time.format.DateTimeFormat#forPattern(String)
103    * @see JodaTimePlugin#getDateTimeFormatterForPattern(String, XWikiContext)
104    */
 
105  0 toggle public DateTimeFormatter getDateTimeFormatterForPattern(String pattern)
106    {
107  0 return getProtectedPlugin().getDateTimeFormatterForPattern(pattern, getXWikiContext());
108    }
109   
110    /**
111    * @see org.joda.time.format.DateTimeFormat#forStyle(String)
112    * @see JodaTimePlugin#getDateTimeFormatterForStyle(String, XWikiContext)
113    */
 
114  0 toggle public DateTimeFormatter getDateTimeFormatterForStyle(String style)
115    {
116  0 return getProtectedPlugin().getDateTimeFormatterForStyle(style, getXWikiContext());
117    }
118   
119    /**
120    * @see org.joda.time.DateTimeZone#getDefault()
121    * @see JodaTimePlugin#getServerTimezone()
122    */
 
123  0 toggle public DateTimeZone getServerTimezone()
124    {
125  0 return getProtectedPlugin().getServerTimezone();
126    }
127   
128    /**
129    * @see org.joda.time.DateTimeZone#UTC
130    * @see JodaTimePlugin#getUTCTimezone()
131    */
 
132  0 toggle public DateTimeZone getUTCTimezone()
133    {
134  0 return getProtectedPlugin().getUTCTimezone();
135    }
136   
137    /**
138    * @see org.joda.time.DateTimeZone#forID(String)
139    * @see JodaTimePlugin#getTimezone(String)
140    */
 
141  0 toggle public DateTimeZone getTimezone(String locationOrOffset)
142    {
143  0 return getProtectedPlugin().getTimezone(locationOrOffset);
144    }
145   
146    /**
147    * @see org.joda.time.DateTimeZone#forOffsetHours(int)
148    * @see JodaTimePlugin#getTimezone(int)
149    */
 
150  0 toggle public DateTimeZone getTimezone(int offsetHours)
151    {
152  0 return getProtectedPlugin().getTimezone(offsetHours);
153    }
154   
155    /**
156    * @see org.joda.time.DateTimeZone#forOffsetHoursMinutes(int, int)
157    * @see JodaTimePlugin#getTimezone(int, int)
158    */
 
159  0 toggle public DateTimeZone getTimezone(int offsetHours, int offsetMinutes)
160    {
161  0 return getProtectedPlugin().getTimezone(offsetHours, offsetMinutes);
162    }
163   
164    /**
165    * @see org.joda.time.Duration#Duration(long)
166    * @see JodaTimePlugin#getDuration(long)
167    */
 
168  0 toggle public Duration getDuration(long millis)
169    {
170  0 return getProtectedPlugin().getDuration(millis);
171    }
172   
173    /**
174    * @see org.joda.time.Duration#Duration(ReadableInstant, ReadableInstant)
175    * @see JodaTimePlugin#getDuration(ReadableInstant, ReadableInstant)
176    */
 
177  0 toggle public Duration getDuration(ReadableInstant from, ReadableInstant to)
178    {
179  0 return getProtectedPlugin().getDuration(from, to);
180    }
181   
182    /**
183    * @return an ISO8601 date time formatter
184    * @since 5.2RC1
185    */
 
186  0 toggle public DateTimeFormatter getISODateTimeFormatter()
187    {
188  0 return getProtectedPlugin().getISODateTimeFormatter();
189    }
190    }