biweekly.property.marshaller
Class DateOrDateTimePropertyMarshaller<T extends DateOrDateTimeProperty>

java.lang.Object
  extended by biweekly.property.marshaller.ICalPropertyMarshaller<T>
      extended by biweekly.property.marshaller.DateOrDateTimePropertyMarshaller<T>
Direct Known Subclasses:
DateDueMarshaller, DateEndMarshaller, DateStartMarshaller, RecurrenceIdMarshaller

public abstract class DateOrDateTimePropertyMarshaller<T extends DateOrDateTimeProperty>
extends ICalPropertyMarshaller<T>

Marshals properties that have either "date" or "date-time" values.

Author:
Michael Angstadt

Nested Class Summary
 
Nested classes/interfaces inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
ICalPropertyMarshaller.DateParser, ICalPropertyMarshaller.DateWriter, ICalPropertyMarshaller.Result<T>, ICalPropertyMarshaller.Splitter
 
Field Summary
 
Fields inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
clazz, propertyName, qname
 
Constructor Summary
DateOrDateTimePropertyMarshaller(Class<T> clazz, String propertyName)
           
 
Method Summary
protected  T _parseText(String value, ICalParameters parameters, List<String> warnings)
          Unmarshals a property's value.
protected  T _parseXml(XCalElement element, ICalParameters parameters, List<String> warnings)
          Unmarshals a property's value from an XML document (xCal).
protected  void _prepareParameters(T property, ICalParameters copy)
          Sanitizes a property's parameters (called before the property is written).
protected  String _writeText(T property)
          Marshals a property's value to a string.
protected  void _writeXml(DateOrDateTimeProperty property, XCalElement element)
          Marshals a property's value to an XML element (xCal).
protected abstract  T newInstance(Date date, boolean hasTime)
           
 
Methods inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
date, date, escape, getPropertyClass, getPropertyName, getQName, parseComponent, parseList, parseText, parseXml, prepareParameters, split, unescape, writeText, writeXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateOrDateTimePropertyMarshaller

public DateOrDateTimePropertyMarshaller(Class<T> clazz,
                                        String propertyName)
Method Detail

_prepareParameters

protected void _prepareParameters(T property,
                                  ICalParameters copy)
Description copied from class: ICalPropertyMarshaller
Sanitizes a property's parameters (called before the property is written). This should be overridden by child classes when required.

Overrides:
_prepareParameters in class ICalPropertyMarshaller<T extends DateOrDateTimeProperty>
Parameters:
property - the property
copy - the list of parameters to make modifications to (it is a copy of the property's parameters)

_writeText

protected String _writeText(T property)
Description copied from class: ICalPropertyMarshaller
Marshals a property's value to a string.

Specified by:
_writeText in class ICalPropertyMarshaller<T extends DateOrDateTimeProperty>
Parameters:
property - the property
Returns:
the marshalled value

_parseText

protected T _parseText(String value,
                       ICalParameters parameters,
                       List<String> warnings)
Description copied from class: ICalPropertyMarshaller
Unmarshals a property's value.

Specified by:
_parseText in class ICalPropertyMarshaller<T extends DateOrDateTimeProperty>
Parameters:
value - the value
parameters - the property's parameters
warnings - allows the programmer to alert the user to any note-worthy (but non-critical) issues that occurred during the unmarshalling process
Returns:
the unmarshalled property object

_writeXml

protected void _writeXml(DateOrDateTimeProperty property,
                         XCalElement element)
Description copied from class: ICalPropertyMarshaller
Marshals a property's value to an XML element (xCal).

Overrides:
_writeXml in class ICalPropertyMarshaller<T extends DateOrDateTimeProperty>
Parameters:
property - the property
element - the XML element

_parseXml

protected T _parseXml(XCalElement element,
                      ICalParameters parameters,
                      List<String> warnings)
Description copied from class: ICalPropertyMarshaller
Unmarshals a property's value from an XML document (xCal).

Overrides:
_parseXml in class ICalPropertyMarshaller<T extends DateOrDateTimeProperty>
Parameters:
element - the property's XML element
parameters - the property's parameters
warnings - allows the programmer to alert the user to any note-worthy (but non-critical) issues that occurred during the unmarshalling process
Returns:
the unmarshalled property object

newInstance

protected abstract T newInstance(Date date,
                                 boolean hasTime)


Copyright © 2013 Michael Angstadt. All Rights Reserved.