org.exolab.castor.types

Class GMonth

public class GMonth extends GMonthDay

Describe an XML schema gMonth type.

The format is defined by W3C XML Schema Recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)

Version: $Revision: 1.2 $

Author: Arnaud Blandin

Constructor Summary
GMonth()
public only for the generated source code
GMonth(short month)
Constructs a XML Schema GMonth instance given all the values of the different fields.
GMonth(int month)
Constructs a XML Schema GMonth instance given all the values of the different fields.
GMonth(String gmonth)
Constructs a GMonth from a string value.
Method Summary
shortgetDay()
static Objectparse(String str)
parse a String and convert it into an java.lang.Object
static GMonthparseGMonth(String str)
parse a String and convert it into a GMonth.
voidsetDay(short day)
DatetoDate()
converts this GMonth into a local java Date.
StringtoString()
convert this GMonth to a string The format is defined by W3C XML Schema recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)

Constructor Detail

GMonth

public GMonth()
public only for the generated source code

GMonth

public GMonth(short month)
Constructs a XML Schema GMonth instance given all the values of the different fields. By default a GMonth is not UTC and is local.

Parameters: month the month value.

GMonth

public GMonth(int month)
Constructs a XML Schema GMonth instance given all the values of the different fields. By default a GMonth is not UTC and is local.

Parameters: month the month value.

GMonth

public GMonth(String gmonth)
Constructs a GMonth from a string value.

Parameters: gmonth the string representation of the GMonth to instantiate

Method Detail

getDay

public short getDay()

parse

public static Object parse(String str)
parse a String and convert it into an java.lang.Object

Parameters: str the string to parse

Returns: an Object represented by the string

Throws: ParseException a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

parseGMonth

public static GMonth parseGMonth(String str)
parse a String and convert it into a GMonth.

Parameters: str the string to parse

Returns: the Date represented by the string

Throws: ParseException a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

setDay

public void setDay(short day)

toDate

public Date toDate()
converts this GMonth into a local java Date.

Returns: a local date representing this Date.

toString

public String toString()
convert this GMonth to a string The format is defined by W3C XML Schema recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)

Returns: a string representing this Date

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