org.exolab.castor.types

Class Month

Implemented Interfaces:
java.io.Serializable

public class Month
extends TimePeriod

Describe an XML schema Month.

The date type is derived from time period by setting up the facet :

Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/ and was last in http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ and was removed by http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/. It was not in the final approved recommendation: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/

Version:
$Revision: 7289 $
Author:
Arnaud Blandin
See Also:
Serialized Form

Constructor Summary

Month()

Method Summary

static Object
parse(String str)
static Month
parseMonth(String str)
parse a String and convert it into a Month
void
setDay(short day)
set the Day Field
void
setHour(short hour)
void
setMinute(short minute)
void
setSecond(short second, short millsecond)
void
setZone(short hour, short minute)
void
setZoneNegative()
java.util.Date
toDate()
convert this recurringDuration into a local Date

Note : Be aware a the 'local' property of the date i.e toDate() will de the conversion between a UTC date and your computer date format.

String
toString()
convert this Month to a string The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CCYY-MM

Methods inherited from class org.exolab.castor.types.TimePeriod

setFields, setPeriod

Methods inherited from class org.exolab.castor.types.RecurringDuration

equal, equals, getCentury, getDay, getMonth, getValues, getYear, isGreater, isLeap, parse, parseRecurringDuration, setCentury, setDay, setMonth, setValues, setYear, toDate, toString

Methods inherited from class org.exolab.castor.types.RecurringDurationBase

equal, equals, getDuration, getHour, getMilli, getMinute, getPeriod, getSeconds, getValues, getZoneHour, getZoneMinute, isGreater, isNegative, isUTC, isZoneNegative, setDuration, setDuration, setHour, setMinute, setNegative, setPeriod, setPeriod, setSecond, setUTC, setValues, setZone, setZoneNegative

Constructor Details

Month

public Month()

Method Details

parse

public static Object parse(String str)
            throws ParseException
Overrides:
parse in interface RecurringDuration

parseMonth

public static Month parseMonth(String str)
            throws ParseException
parse a String and convert it into a Month
Parameters:
str - the string to parse
Returns:
the Month represented by the string

setDay

public void setDay(short day)
            throws UnsupportedOperationException
set the Day Field
Overrides:
setDay in interface RecurringDuration
Parameters:
day - the value to set up Note a validation is done on the day field

setHour

public void setHour(short hour)
            throws UnsupportedOperationException
Overrides:
setHour in interface RecurringDurationBase

setMinute

public void setMinute(short minute)
            throws UnsupportedOperationException
Overrides:
setMinute in interface RecurringDurationBase

setSecond

public void setSecond(short second,
                      short millsecond)
            throws UnsupportedOperationException
Overrides:
setSecond in interface RecurringDurationBase

setZone

public void setZone(short hour,
                    short minute)
            throws UnsupportedOperationException
Overrides:
setZone in interface RecurringDurationBase

setZoneNegative

public void setZoneNegative()
            throws UnsupportedOperationException
Overrides:
setZoneNegative in interface RecurringDurationBase

toDate

public java.util.Date toDate()
            throws ParseException
convert this recurringDuration into a local Date

Note : Be aware a the 'local' property of the date i.e toDate() will de the conversion between a UTC date and your computer date format. For instance if you have set up your computer time zone on the Pacific Day Time the conversion of 2000-10-20T00:00:00.000 into a java.util.Date will return Thu Oct 19 17:00:00 PDT 2000

Overrides:
toDate in interface RecurringDuration
Returns:
a local date representing this recurringDuration

toString

public String toString()
convert this Month to a string The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CCYY-MM
Overrides:
toString in interface RecurringDuration
Returns:
a string representing this Month

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com