biweekly.property.marshaller
Class ICalPropertyMarshaller.DateWriter

java.lang.Object
  extended by biweekly.property.marshaller.ICalPropertyMarshaller.DateWriter
Enclosing class:
ICalPropertyMarshaller<T extends ICalProperty>

protected static class ICalPropertyMarshaller.DateWriter
extends Object

Factory class for writing dates.


Constructor Summary
ICalPropertyMarshaller.DateWriter(Date date)
          Creates a new date writer object.
 
Method Summary
 ICalPropertyMarshaller.DateWriter extended(boolean extended)
          Sets whether to use extended format or basic.
 ICalPropertyMarshaller.DateWriter localTz(boolean localTz)
          Outputs the date in local time (without a timezone).
 ICalPropertyMarshaller.DateWriter time(boolean hasTime)
          Sets whether to output the date's time component.
 ICalPropertyMarshaller.DateWriter tz(boolean localTz, String timezoneId)
          Convenience method that combines localTz(boolean) and tzid(String) into one method.
 ICalPropertyMarshaller.DateWriter tz(TimeZone timezone)
          Sets the timezone to format the date as.
 ICalPropertyMarshaller.DateWriter tzid(String timezoneId)
          Sets the ID of the timezone to format the date as (TZID parameter value).
 String write()
          Creates the date string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICalPropertyMarshaller.DateWriter

public ICalPropertyMarshaller.DateWriter(Date date)
Creates a new date writer object.

Parameters:
date - the date to format
Method Detail

time

public ICalPropertyMarshaller.DateWriter time(boolean hasTime)
Sets whether to output the date's time component.

Parameters:
hasTime - true include the time, false if it's strictly a date (defaults to "true")
Returns:
this

tzid

public ICalPropertyMarshaller.DateWriter tzid(String timezoneId)
Sets the ID of the timezone to format the date as (TZID parameter value).

Parameters:
timezoneId - the timezone ID. If the ID is global (contains a "/" character), it will attempt to look up the timezone in Java's timezone registry and format the date according to that timezone. If the timezone is not found, the date will be formatted in UTC. If the ID is not global, it will be formatted according to the JVM's default timezone. If no timezone preference is specified, the date will be formatted as UTC.
Returns:
this

localTz

public ICalPropertyMarshaller.DateWriter localTz(boolean localTz)
Outputs the date in local time (without a timezone). If no timezone preference is specified, the date will be formatted as UTC.

Parameters:
localTz - true to use local time, false not to
Returns:
this

tz

public ICalPropertyMarshaller.DateWriter tz(boolean localTz,
                                            String timezoneId)
Convenience method that combines localTz(boolean) and tzid(String) into one method.

Parameters:
localTz - true to use local time, false not to
timezoneId - the timezone ID
Returns:
this

tz

public ICalPropertyMarshaller.DateWriter tz(TimeZone timezone)
Sets the timezone to format the date as. If no timezone preference is specified, the date will be formatted as UTC.

Parameters:
timezone - the timezone
Returns:
this

extended

public ICalPropertyMarshaller.DateWriter extended(boolean extended)
Sets whether to use extended format or basic.

Parameters:
extended - true to use extended format, false to use basic (defaults to "false")
Returns:
this

write

public String write()
Creates the date string.

Returns:
the date string


Copyright © 2013 Michael Angstadt. All Rights Reserved.