Public Member Functions | |
| Date () | |
| Date (short[] values) | |
| Date (java.util.Date dateRef) | |
| Date (String date) throws java.text.ParseException | |
| void | setValues (short[] values) |
| short[] | getValues () |
| java.util.Date | toDate () |
| String | toString () |
| short | getHour () |
| short | getMinute () |
| short | getSeconds () |
| short | getMilli () |
| void | setHour (short hour) |
| void | setMinute (short minute) |
| void | setSecond (short second) |
| void | setMilliSecond (short millisecond) |
Static Public Member Functions | |
| static Object | parse (String str) throws ParseException |
| static Date | parseDate (String str) throws ParseException |
Static Public Attributes | |
| static final String | DATE_FORMAT = "yyyy-MM-dd" |
Describe an XML schema Date.
The format is defined by W3C XML Schema Recommendation and ISO8601 i.e (-)CCYY-MM-DD(Z|(+|-)hh:mm)
| org.exolab.castor.types.Date.Date | ( | ) |
Referenced by org.exolab.castor.types.Date.parseDate(), org.exolab.castor.types.Year.toDate(), org.exolab.castor.types.Month.toDate(), org.exolab.castor.types.GYearMonth.toDate(), org.exolab.castor.types.GYear.toDate(), org.exolab.castor.types.GMonthDay.toDate(), org.exolab.castor.types.GMonth.toDate(), org.exolab.castor.types.GDay.toDate(), org.exolab.castor.types.Date.toDate(), and org.exolab.castor.types.Century.toDate().
| org.exolab.castor.types.Date.Date | ( | short[] | values | ) |
Constructs a XML Schema Date instance given all the values of the different fields. By default a Date is not UTC and is local.
| values | an array of shorts that represent the different fields of Time. |
References org.exolab.castor.types.Date.setValues().
| org.exolab.castor.types.Date.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
References org.exolab.castor.types.DateTimeBase.setCentury(), org.exolab.castor.types.DateTimeBase.setDay(), org.exolab.castor.types.DateTimeBase.setMonth(), and org.exolab.castor.types.DateTimeBase.setYear().
| org.exolab.castor.types.Date.Date | ( | String | date | ) | throws java.text.ParseException |
Constructs a date from a string
| date | the string representing the date |
| short org.exolab.castor.types.Date.getHour | ( | ) |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| short org.exolab.castor.types.Date.getMilli | ( | ) |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| short org.exolab.castor.types.Date.getMinute | ( | ) |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| short org.exolab.castor.types.Date.getSeconds | ( | ) |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| short [] org.exolab.castor.types.Date.getValues | ( | ) | [virtual] |
Returns an array of short with all the fields that describe this Date type.
Note:the time zone is not included.
Implements org.exolab.castor.types.DateTimeBase.
Reimplemented in org.exolab.castor.types.GMonthDay, org.exolab.castor.types.GYear, and org.exolab.castor.types.GYearMonth.
References org.exolab.castor.types.DateTimeBase.getCentury(), org.exolab.castor.types.DateTimeBase.getDay(), org.exolab.castor.types.DateTimeBase.getMonth(), and org.exolab.castor.types.DateTimeBase.getYear().
| static Object org.exolab.castor.types.Date.parse | ( | String | str | ) | throws ParseException [static] |
parse a String and convert it into an java.lang.Object
| str | the string to parse |
| ParseException | a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class) |
Reimplemented in org.exolab.castor.types.GDay, org.exolab.castor.types.GMonth, org.exolab.castor.types.GMonthDay, org.exolab.castor.types.GYear, and org.exolab.castor.types.GYearMonth.
References org.exolab.castor.types.Date.parseDate().
Referenced by org.exolab.castor.types.Time.toDate(), and org.exolab.castor.types.RecurringDuration.toDate().
| static Date org.exolab.castor.types.Date.parseDate | ( | String | str | ) | throws ParseException [static] |
parse a String and convert it into a Date.
| str | the string to parse |
| ParseException | a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class) |
References org.exolab.castor.types.Date.Date().
Referenced by org.exolab.castor.types.Date.parse().
| void org.exolab.castor.types.Date.setHour | ( | short | hour | ) |
set the hour field for this date/time type.
| hour | the hour to set |
| OperationNotSupportedException | this exception is thrown when changing the value of the hour field is not allowed |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| void org.exolab.castor.types.Date.setMilliSecond | ( | short | millisecond | ) |
Sets the millisecond field for this date/time type
| millsecond | the millisecond to set |
| OperationNotSupportedException | this exception is thrown when changing the value of the second field is not allowed |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| void org.exolab.castor.types.Date.setMinute | ( | short | minute | ) |
set the minute field for this date/time type.
| minute | the minute to set. |
| OperationNotSupportedException | this exception is thrown when changing the value of the minute field is not allowed |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| void org.exolab.castor.types.Date.setSecond | ( | short | second | ) |
Sets the second field for this date/time type
| second | the second to set |
| OperationNotSupportedException | this exception is thrown when changing the value of the second field is not allowed |
Reimplemented from org.exolab.castor.types.DateTimeBase.
| void org.exolab.castor.types.Date.setValues | ( | short[] | values | ) | [virtual] |
Sets all the fields by reading the values in an array
if a Time Zone is specificied it has to be set by using setZone.
| values | an array of shorts with the values the array is supposed to be of length 4 and ordered like the following:
|
Implements org.exolab.castor.types.DateTimeBase.
Reimplemented in org.exolab.castor.types.GMonthDay, org.exolab.castor.types.GYear, and org.exolab.castor.types.GYearMonth.
References org.exolab.castor.types.DateTimeBase.setCentury(), org.exolab.castor.types.DateTimeBase.setDay(), org.exolab.castor.types.DateTimeBase.setMonth(), and org.exolab.castor.types.DateTimeBase.setYear().
Referenced by org.exolab.castor.types.Date.Date().
| java.util.Date org.exolab.castor.types.Date.toDate | ( | ) | [virtual] |
converts this Date into a local java Date.
Implements org.exolab.castor.types.DateTimeBase.
Reimplemented in org.exolab.castor.types.GDay, org.exolab.castor.types.GMonth, org.exolab.castor.types.GMonthDay, org.exolab.castor.types.GYear, and org.exolab.castor.types.GYearMonth.
References org.exolab.castor.types.Date.Date(), org.exolab.castor.types.Date.DATE_FORMAT, org.exolab.castor.types.DateTimeBase.getZoneHour(), org.exolab.castor.types.DateTimeBase.getZoneMinute(), org.exolab.castor.types.DateTimeBase.isUTC(), org.exolab.castor.types.DateTimeBase.isZoneNegative(), and org.exolab.castor.types.Date.toString().
| String org.exolab.castor.types.Date.toString | ( | ) |
convert this Date to a string The format is defined by W3C XML Schema recommendation and ISO8601 i.e (+|-)CCYY-MM-DD
Reimplemented in org.exolab.castor.types.GDay, org.exolab.castor.types.GMonth, org.exolab.castor.types.GMonthDay, org.exolab.castor.types.GYear, and org.exolab.castor.types.GYearMonth.
References org.exolab.castor.types.DateTimeBase.getCentury(), org.exolab.castor.types.DateTimeBase.getDay(), org.exolab.castor.types.DateTimeBase.getMonth(), org.exolab.castor.types.DateTimeBase.getYear(), org.exolab.castor.types.DateTimeBase.getZoneHour(), org.exolab.castor.types.DateTimeBase.getZoneMinute(), org.exolab.castor.types.DateTimeBase.isNegative(), org.exolab.castor.types.DateTimeBase.isUTC(), and org.exolab.castor.types.DateTimeBase.isZoneNegative().
Referenced by org.exolab.castor.types.DateDescriptor.DateFieldHandler.getValue(), org.exolab.castor.types.Date.toDate(), and org.exolab.castor.builder.types.XSDate.validationCode().
final String org.exolab.castor.types.Date.DATE_FORMAT = "yyyy-MM-dd" [static] |
The Date Format
Referenced by org.exolab.castor.types.Date.toDate().
1.7.0