biweekly.property.marshaller
Class RawPropertyMarshaller

java.lang.Object
  extended by biweekly.property.marshaller.ICalPropertyMarshaller<RawProperty>
      extended by biweekly.property.marshaller.RawPropertyMarshaller

public class RawPropertyMarshaller
extends ICalPropertyMarshaller<RawProperty>

Marshals properties that do not have a marshaller associated with them.

Author:
Michael Angstadt

Nested Class Summary
 
Nested classes/interfaces inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
ICalPropertyMarshaller.DateParser, ICalPropertyMarshaller.DateWriter, ICalPropertyMarshaller.ListCallback<T>, ICalPropertyMarshaller.Result<T extends ICalProperty>, ICalPropertyMarshaller.SemiStructuredIterator, ICalPropertyMarshaller.Splitter, ICalPropertyMarshaller.StructuredIterator
 
Field Summary
 
Fields inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
clazz, defaultDataType, propertyName, qname
 
Constructor Summary
RawPropertyMarshaller(String propertyName)
           
 
Method Summary
protected  ICalDataType _dataType(RawProperty property)
           Determines the data type of a property instance.
protected  RawProperty _parseText(String value, ICalDataType dataType, ICalParameters parameters, List<String> warnings)
          Unmarshals a property from a plain-text iCalendar data stream.
protected  RawProperty _parseXml(XCalElement element, ICalParameters parameters, List<String> warnings)
           Unmarshals a property from an XML document (xCal).
protected  String _writeText(RawProperty property)
          Marshals a property's value to a string.
 
Methods inherited from class biweekly.property.marshaller.ICalPropertyMarshaller
_parseJson, _prepareParameters, _writeJson, _writeXml, dataType, date, date, escape, getDefaultDataType, getPropertyClass, getPropertyName, getQName, list, list, list, list, missingXmlElements, missingXmlElements, object, object, parseJson, parseText, parseXml, prepareParameters, semistructured, semistructured, split, structured, structured, structured, unescape, writeJson, writeText, writeXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawPropertyMarshaller

public RawPropertyMarshaller(String propertyName)
Method Detail

_dataType

protected ICalDataType _dataType(RawProperty property)
Description copied from class: ICalPropertyMarshaller

Determines the data type of a property instance.

This method should be overridden by child classes if a property's data type changes depending on its value. The default implementation of this method returns the property's default data type.

Overrides:
_dataType in class ICalPropertyMarshaller<RawProperty>
Parameters:
property - the property
Returns:
the data type or null if unknown

_writeText

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

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

_parseText

protected RawProperty _parseText(String value,
                                 ICalDataType dataType,
                                 ICalParameters parameters,
                                 List<String> warnings)
Description copied from class: ICalPropertyMarshaller
Unmarshals a property from a plain-text iCalendar data stream.

Specified by:
_parseText in class ICalPropertyMarshaller<RawProperty>
Parameters:
value - the value as read off the wire
dataType - the data type of the property value. The property's VALUE parameter is used to determine the data type. If the property has no VALUE parameter, then this parameter will be set to the property's default datatype. Note that the VALUE parameter is removed from the property's parameter list after it has been read.
parameters - the parsed parameters. These parameters will be assigned to the property object once this method returns. Therefore, do not assign any parameters to the property object itself whilst inside of this method, or else they will be overwritten.
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

_parseXml

protected RawProperty _parseXml(XCalElement element,
                                ICalParameters parameters,
                                List<String> warnings)
Description copied from class: ICalPropertyMarshaller

Unmarshals a property from an XML document (xCal).

This method should be overridden by child classes that wish to support xCal. The default implementation of this method will find the first child element with the xCal namespace. The element's name will be used as the property's data type and its text content will be passed into the ICalPropertyMarshaller._parseText(java.lang.String, biweekly.ICalDataType, biweekly.parameter.ICalParameters, java.util.List) method. If no such child element is found, then the parent element's text content will be passed into ICalPropertyMarshaller._parseText(java.lang.String, biweekly.ICalDataType, biweekly.parameter.ICalParameters, java.util.List) and the data type will be null.

Overrides:
_parseXml in class ICalPropertyMarshaller<RawProperty>
Parameters:
element - the property's XML element
parameters - the parsed parameters. These parameters will be assigned to the property object once this method returns. Therefore, do not assign any parameters to the property object itself whilst inside of this method, or else they will be overwritten.
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


Copyright © 2013 Michael Angstadt. All Rights Reserved.