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 time(boolean hasTime)
          Sets whether to output the date's time component.
 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). If the ID does not contain a "/" character, it will be ignored. If the ID is invalid, the date will be formatted according to the JVM's default timezone. If no timezone is specified, the date will be formatted as UTC.

Parameters:
timezoneId - the timezone ID
Returns:
this

tz

public ICalPropertyMarshaller.DateWriter tz(TimeZone timezone)
Sets the timezone to format the date as. If no timezone 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.