com.xpn.xwiki.plugin.jodatime
Class JodaTimePlugin

java.lang.Object
  extended by com.xpn.xwiki.plugin.XWikiDefaultPlugin
      extended by com.xpn.xwiki.plugin.jodatime.JodaTimePlugin
All Implemented Interfaces:
com.xpn.xwiki.plugin.XWikiPluginInterface

public class JodaTimePlugin
extends com.xpn.xwiki.plugin.XWikiDefaultPlugin

Plugin for manipulating dates from velocity scripts inside xwiki documents. It is based on the JodaTime framework, a quality replacement for the Java date and time classes.

See Also:
JodaTimePluginApi

Constructor Summary
JodaTimePlugin(String name, String className, com.xpn.xwiki.XWikiContext context)
           
 
Method Summary
 org.joda.time.DateTime getDateTime()
           
 org.joda.time.DateTime getDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
           
 org.joda.time.DateTime getDateTime(long instant)
           
 org.joda.time.format.DateTimeFormatter getDateTimeFormatterForPattern(String pattern, com.xpn.xwiki.XWikiContext context)
           
 org.joda.time.format.DateTimeFormatter getDateTimeFormatterForStyle(String style, com.xpn.xwiki.XWikiContext context)
           
 org.joda.time.MutableDateTime getMutableDateTime()
           
 org.joda.time.MutableDateTime getMutableDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
           
 org.joda.time.MutableDateTime getMutableDateTime(long instant)
           
 String getName()
           
 Api getPluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface plugin, com.xpn.xwiki.XWikiContext context)
           
 org.joda.time.DateTimeZone getServerTimezone()
           
 org.joda.time.DateTimeZone getTimezone(int offsetHours)
           
 org.joda.time.DateTimeZone getTimezone(int offsetHours, int offsetMinutes)
           
 org.joda.time.DateTimeZone getTimezone(String locationOrOffset)
           
 org.joda.time.DateTimeZone getUTCTimezone()
           
 void init(com.xpn.xwiki.XWikiContext context)
          
 
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, insidePREHandler, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JodaTimePlugin

public JodaTimePlugin(String name,
                      String className,
                      com.xpn.xwiki.XWikiContext context)
Parameters:
name - the plugin name, usually ignored, since plugins have a fixed name
className - the name of this class, ignored
context - the current request context
Method Detail

getName

public String getName()
Specified by:
getName in interface com.xpn.xwiki.plugin.XWikiPluginInterface
Overrides:
getName in class com.xpn.xwiki.plugin.XWikiDefaultPlugin

getPluginApi

public Api getPluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface plugin,
                        com.xpn.xwiki.XWikiContext context)
Specified by:
getPluginApi in interface com.xpn.xwiki.plugin.XWikiPluginInterface
Overrides:
getPluginApi in class com.xpn.xwiki.plugin.XWikiDefaultPlugin

init

public void init(com.xpn.xwiki.XWikiContext context)

Specified by:
init in interface com.xpn.xwiki.plugin.XWikiPluginInterface
Overrides:
init in class com.xpn.xwiki.plugin.XWikiDefaultPlugin

getDateTime

public org.joda.time.DateTime getDateTime()
See Also:
DateTime.DateTime()

getDateTime

public org.joda.time.DateTime getDateTime(int year,
                                          int monthOfYear,
                                          int dayOfMonth,
                                          int hourOfDay,
                                          int minuteOfHour,
                                          int secondOfMinute,
                                          int millisOfSecond)
See Also:
DateTime.DateTime(int, int, int, int, int, int, int)

getDateTime

public org.joda.time.DateTime getDateTime(long instant)
See Also:
DateTime.DateTime(long)

getMutableDateTime

public org.joda.time.MutableDateTime getMutableDateTime()
See Also:
MutableDateTime.MutableDateTime()

getMutableDateTime

public org.joda.time.MutableDateTime getMutableDateTime(int year,
                                                        int monthOfYear,
                                                        int dayOfMonth,
                                                        int hourOfDay,
                                                        int minuteOfHour,
                                                        int secondOfMinute,
                                                        int millisOfSecond)
See Also:
MutableDateTime.MutableDateTime(int, int, int, int, int, int, int)

getMutableDateTime

public org.joda.time.MutableDateTime getMutableDateTime(long instant)
See Also:
MutableDateTime.MutableDateTime(long)

getDateTimeFormatterForPattern

public org.joda.time.format.DateTimeFormatter getDateTimeFormatterForPattern(String pattern,
                                                                             com.xpn.xwiki.XWikiContext context)
See Also:
DateTimeFormat.forPattern(String)

getDateTimeFormatterForStyle

public org.joda.time.format.DateTimeFormatter getDateTimeFormatterForStyle(String style,
                                                                           com.xpn.xwiki.XWikiContext context)
See Also:
DateTimeFormat.forStyle(String)

getServerTimezone

public org.joda.time.DateTimeZone getServerTimezone()
See Also:
DateTimeZone.getDefault()

getUTCTimezone

public org.joda.time.DateTimeZone getUTCTimezone()
See Also:
DateTimeZone.UTC

getTimezone

public org.joda.time.DateTimeZone getTimezone(String locationOrOffset)
See Also:
DateTimeZone.forID(String)

getTimezone

public org.joda.time.DateTimeZone getTimezone(int offsetHours)
See Also:
DateTimeZone.forOffsetHours(int)

getTimezone

public org.joda.time.DateTimeZone getTimezone(int offsetHours,
                                              int offsetMinutes)
See Also:
DateTimeZone.forOffsetHoursMinutes(int, int)


Copyright © 2004-2012 XWiki. All Rights Reserved.