org.exolab.castor.types
Class Date

java.lang.Object
  |
  +--org.exolab.castor.types.RecurringDurationBase
        |
        +--org.exolab.castor.types.RecurringDuration
              |
              +--org.exolab.castor.types.TimePeriod
                    |
                    +--org.exolab.castor.types.Date

public class Date
extends TimePeriod

Describe an XML schema Date The date type is derived from time period by setting up the facet :

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

Constructor Summary
Date()
           
Date(java.util.Date dateRef)
          This constructor is used to convert a java.util.Date into a new org.exolab.castor.types.Date
 
Method Summary
static java.lang.Object parse(java.lang.String str)
          parse a String and convert it into an java.lang.Object
static Date parseDate(java.lang.String str)
          parse a String and convert it into a Date
 void setHour(short hour)
          set the hour field for this recurringDuration
 void setMinute(short minute)
          set the minute field for this recurringDuration
 void setSecond(short second, short millsecond)
          set the second field for this recurringDuration
 void setZone(short hour, short minute)
          set the time zone fields for this recurringDuration
 void setZoneNegative()
          set the time zone negative field to true
 java.lang.String toString()
          convert this Date to a string The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CCYY-MM-DD
 
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, parseRecurring, setCentury, setDay, setMonth, setValues, setYear, toDate
 
Methods inherited from class org.exolab.castor.types.RecurringDurationBase
equal, getDuration, getHour, getMilli, getMinute, getPeriod, getSeconds, getZoneHour, getZoneMinute, isGreater, isNegative, isUTC, isZoneNegative, setDuration, setDuration, setNegative, setPeriod, setUTC
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

public Date()

Date

public Date(java.util.Date dateRef)
This constructor is used to convert a java.util.Date into a new org.exolab.castor.types.Date

Note : all the information concerning the time part of the java.util.Date is lost since a W3C Schema Date only represents CCYY-MM-YY

Method Detail

setHour

public void setHour(short hour)
             throws OperationNotSupportedException
Description copied from class: RecurringDurationBase
set the hour field for this recurringDuration
Overrides:
setHour in class RecurringDurationBase
Tags copied from class: RecurringDurationBase
Parameters:
hour - the hour to set
Throws:
OperationNotSupportedException - this exception is thrown when changing the value of the hour field is not allowed

setMinute

public void setMinute(short minute)
               throws OperationNotSupportedException
Description copied from class: RecurringDurationBase
set the minute field for this recurringDuration
Overrides:
setMinute in class RecurringDurationBase
Tags copied from class: RecurringDurationBase
Parameters:
minute - the minute to set
Throws:
OperationNotSupportedException - this exception is thrown when changing the value of the minute field is not allowed

setSecond

public void setSecond(short second,
                      short millsecond)
               throws OperationNotSupportedException
Description copied from class: RecurringDurationBase
set the second field for this recurringDuration
Overrides:
setSecond in class RecurringDurationBase
Tags copied from class: RecurringDurationBase
Parameters:
second - the second to set
millsecond - the millisecond to set
Throws:
OperationNotSupportedException - this exception is thrown when changing the value of the second field is not allowed

setZone

public void setZone(short hour,
                    short minute)
             throws OperationNotSupportedException
Description copied from class: RecurringDurationBase
set the time zone fields for this recurringDuration
Overrides:
setZone in class RecurringDurationBase
Tags copied from class: RecurringDurationBase
Parameters:
hour - the time zone hour to set
minute - the time zone minute to set
Throws:
OperationNotSupportedException - this exception is thrown when changing the value of the time zone fields is not allowed

setZoneNegative

public void setZoneNegative()
                     throws OperationNotSupportedException
Description copied from class: RecurringDurationBase
set the time zone negative field to true
Overrides:
setZoneNegative in class RecurringDurationBase
Tags copied from class: RecurringDurationBase
Throws:
OperationNotSupportedException - this exception is thrown when changing the time zone fields is not allowed

toString

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

parse

public static java.lang.Object parse(java.lang.String str)
                              throws java.text.ParseException
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:
java.text.ParseException - a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

parseDate

public static Date parseDate(java.lang.String str)
                      throws java.text.ParseException
parse a String and convert it into a Date
Parameters:
str - the string to parse
Returns:
the Date represented by the string
Throws:
java.text.ParseException - a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)


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