net.fortuna.ical4j.model.property

Class DateProperty


public abstract class DateProperty
extends Property

$Id: DateProperty.java,v 1.31 2008/12/30 11:37:17 fortuna Exp $ Created on 9/07/2005 Base class for properties with a DATE or DATE-TIME value. Note that some sub-classes may only allow either a DATE or a DATE-TIME value, for which additional rules/validation should be specified.

Constructor Summary

DateProperty(String name)
DateProperty(String name, ParameterList parameters)
DateProperty(String name, TimeZone timezone)
Creates a new instance of the named property with an initial timezone.

Method Summary

Property
copy()
Date
getDate()
TimeZone
getTimeZone()
String
getValue()
boolean
isUtc()
Indicates whether the current date value is specified in UTC time.
void
setDate(Date date)
Sets the date value of this property.
void
setTimeZone(TimeZone timezone)
Publically available method to update the current timezone.
void
setUtc(boolean utc)
Resets the VTIMEZONE associated with the property.
void
setValue(String value)
Default setValue() implementation.
void
validate()

Constructor Details

DateProperty

public DateProperty(String name)
Parameters:

DateProperty

public DateProperty(String name,
                    ParameterList parameters)
Parameters:

DateProperty

public DateProperty(String name,
                    TimeZone timezone)
Creates a new instance of the named property with an initial timezone.
Parameters:
name - property name

Method Details

copy

public Property copy()
            throws IOException,
                   URISyntaxException,
                   ParseException

getDate

public final Date getDate()
Returns:
Returns the date.

getTimeZone

public final TimeZone getTimeZone()
Returns:
the timezone

getValue

public String getValue()

isUtc

public final boolean isUtc()
Indicates whether the current date value is specified in UTC time.
Returns:

setDate

public final void setDate(Date date)
Sets the date value of this property. The timezone and value of this instance will also be updated accordingly.
Parameters:
date - The date to set.

setTimeZone

public void setTimeZone(TimeZone timezone)
Publically available method to update the current timezone.
Parameters:

setUtc

public final void setUtc(boolean utc)
Resets the VTIMEZONE associated with the property. If utc is true, any TZID parameters are removed and the Java timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the default timezone (i.e. represents a "floating" local time)
Parameters:
utc -

setValue

public void setValue(String value)
            throws ParseException
Default setValue() implementation. Allows for either DATE or DATE-TIME values.

validate

public void validate()
            throws ValidationException