Joda System API

org.joda.property.type
Interface DateProperty

All Superinterfaces:
java.lang.Comparable, DataProperty, InstantProperty, ModelElement, Property, org.joda.time.ReadableInstant, org.joda.time.ReadWritableInstant, java.io.Serializable
All Known Subinterfaces:
DateTimeProperty
All Known Implementing Classes:
DefaultDateProperty, DefaultDateTimeProperty

public interface DateProperty
extends InstantProperty, org.joda.time.ReadWritableInstant

Interface for Date properties, based on ISO8601 date definitions. The methods on DateProperty represent the 'normal' date concepts used by most Loclaes - Gregorian. The decision to merge the functionality of the Java Date, Calendar and GregorianCalendar classes was taken to provide a more obvious interface. The specific get methods return values in the ranges from the ISO standard, thus months are 1 based. Constructors should respect this convention. It is expected that implementations cannot hold invalid dates, thus exceptions should be thrown by constructors and set methods.

Calendar does not describe a standard String format. However such a format is required for various property methods. The String format must completely encapsulate the property's value and be portable so far as possible between two completely different implementations. To achieve this the basic String format is ISO8601.

Output Dates

The format is YYYY-MM-DD. For example, for 31st January 2002:
2002-01-31

Input Dates

Various formats are accepted. For example, considering 31st January 2002:
2002-01-31 or 20020131 (full representation)
2002-01 or 200201 (month only)
2002 or 2002 (year only)
20 (century only)
2002-W05 or 2002W05 (week only)
2002-W05-4 or 2002W054 (full representation as fourth day in fifth week)
2002-031 or 2002031 (full representation as 31st day in year)

DateTime

The format is the Date part followed by a 'T' then the time part.

Week 1 is the week that the 4th January is in, as this means it is mostly in that year. Note weeks can range from 01-53 and can include days in another year.
Weekdays are Monday(1) to Sunday(7).
Days in year are from 001 to 366.
Midnight should be represented as 00:00, but 24:00 is accepted.
A dash may be used to represent missing portions of the string. One dash is used to represent the part missing even if it is more than one character normally.
To indicate time BC, prefix by BC. If you explicitly want to represent AD, then use CD as the prefix. (from ANSI X3.30).
The letters (W/BC/CD) may be lower case.

Author:
Stephen Colebourne

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Field Summary
static java.lang.Class DEFAULT_TYPE
           
 
Methods inherited from interface org.joda.property.type.InstantProperty
get, toCalendar, toDate, toGregorianCalendar
 
Methods inherited from interface org.joda.property.type.DataProperty
toDataString
 
Methods inherited from interface org.joda.property.Property
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, getPropertyType, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, set, setModifiable, setReadOnly, toObject, toString
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from interface org.joda.time.ReadWritableInstant
add, add, addMillis, addWrapped, set, setMillis, setMillis
 
Methods inherited from interface org.joda.time.ReadableInstant
compareTo, equals, get, getChronology, getDateTimeZone, getMillis, hashCode, isAfter, isBefore, isEqual, toCopy, toCopy, toInstant, toString
 

Field Detail

DEFAULT_TYPE

public static final java.lang.Class DEFAULT_TYPE

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.