public class ExceptionDatesScribe extends ListPropertyScribe<ExceptionDates,ICalDate>
ExceptionDates
properties.ICalPropertyScribe.DateParser, ICalPropertyScribe.DateWriter, ICalPropertyScribe.ListCallback<T>, ICalPropertyScribe.Result<T>, ICalPropertyScribe.SemiStructuredIterator, ICalPropertyScribe.Splitter, ICalPropertyScribe.StructuredIterator
clazz, propertyName, qname
Constructor and Description |
---|
ExceptionDatesScribe() |
Modifier and Type | Method and Description |
---|---|
protected ICalDataType |
_dataType(ExceptionDates property,
ICalVersion version)
Determines the data type of a property instance.
|
protected ICalDataType |
_defaultDataType(ICalVersion version)
Determines the default data type of this property.
|
protected ExceptionDates |
_parseJson(JCalValue value,
ICalDataType dataType,
ICalParameters parameters,
ParseContext context)
Unmarshals a property from a JSON data stream (jCal).
|
protected ExceptionDates |
_parseXml(XCalElement element,
ICalParameters parameters,
ParseContext context)
Unmarshals a property from an XML document (xCal).
|
protected ICalParameters |
_prepareParameters(ExceptionDates property,
WriteContext context)
Sanitizes a property's parameters before the property is written.
|
protected JCalValue |
_writeJson(ExceptionDates property,
WriteContext context)
Marshals a property's value to a JSON data stream (jCal).
|
protected void |
_writeXml(ExceptionDates property,
XCalElement element,
WriteContext context)
Marshals a property's value to an XML element (xCal).
|
protected ExceptionDates |
newInstance(ICalDataType dataType,
ICalParameters parameters) |
protected ICalDate |
readValue(ExceptionDates property,
String value,
ICalDataType dataType,
ICalParameters parameters,
ParseContext context) |
protected String |
writeValue(ExceptionDates property,
ICalDate value,
WriteContext context) |
_parseText, _writeText
dataType, date, date, date, date, date, defaultDataType, escape, getPropertyClass, getPropertyName, getQName, getSupportedVersions, handleTzidParameter, isInObservance, list, list, list, list, missingXmlElements, missingXmlElements, object, object, parseJson, parseText, parseXml, prepareParameters, semistructured, semistructured, splitter, structured, structured, structured, unescape, writeJson, writeText, writeXml
public ExceptionDatesScribe()
protected ICalDataType _defaultDataType(ICalVersion version)
ICalPropertyScribe
Determines the default data type of this property.
This method should be overridden by child classes if a property's default
data type changes depending the iCalendar version. The default
implementation of this method returns the data type that was passed into
the ICalPropertyScribe.ICalPropertyScribe(Class, String, ICalDataType)
constructor.
Null is returned if this constructor was not invoked.
_defaultDataType
in class ICalPropertyScribe<ExceptionDates>
version
- the version of the iCalendar object being generatedprotected ICalParameters _prepareParameters(ExceptionDates property, WriteContext context)
ICalPropertyScribe
Sanitizes a property's parameters before the property is written.
This method should be overridden by child classes that wish to tweak the property's parameters before the property is written. The default implementation of this method returns the property's parameters unmodified.
_prepareParameters
in class ICalPropertyScribe<ExceptionDates>
property
- the property to writecontext
- the contextprotected ICalDataType _dataType(ExceptionDates property, ICalVersion version)
ICalPropertyScribe
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.
_dataType
in class ICalPropertyScribe<ExceptionDates>
property
- the propertyversion
- the version of the iCalendar object being generatedprotected ExceptionDates newInstance(ICalDataType dataType, ICalParameters parameters)
newInstance
in class ListPropertyScribe<ExceptionDates,ICalDate>
protected String writeValue(ExceptionDates property, ICalDate value, WriteContext context)
writeValue
in class ListPropertyScribe<ExceptionDates,ICalDate>
protected ICalDate readValue(ExceptionDates property, String value, ICalDataType dataType, ICalParameters parameters, ParseContext context)
readValue
in class ListPropertyScribe<ExceptionDates,ICalDate>
protected void _writeXml(ExceptionDates property, XCalElement element, WriteContext context)
ICalPropertyScribe
Marshals a property's value to an XML element (xCal).
This method should be overridden by child classes that wish to support
xCal. The default implementation of this method will append one child
element to the property's XML element. The child element's name will be
that of the property's data type (retrieved using the ICalPropertyScribe.dataType(T, biweekly.ICalVersion)
method), and the child element's text content will be set to the
property's marshalled plain-text value (retrieved using the
ICalPropertyScribe.writeText(T, biweekly.io.WriteContext)
method).
_writeXml
in class ListPropertyScribe<ExceptionDates,ICalDate>
property
- the propertyelement
- the property's XML elementcontext
- the contextprotected ExceptionDates _parseXml(XCalElement element, ICalParameters parameters, ParseContext context)
ICalPropertyScribe
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
ICalPropertyScribe._parseText(java.lang.String, biweekly.ICalDataType, biweekly.parameter.ICalParameters, biweekly.io.ParseContext)
method. If no such child element is found, then the
parent element's text content will be passed into ICalPropertyScribe._parseText(java.lang.String, biweekly.ICalDataType, biweekly.parameter.ICalParameters, biweekly.io.ParseContext)
and
the data type will be null.
_parseXml
in class ListPropertyScribe<ExceptionDates,ICalDate>
element
- the property's XML elementparameters
- 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.context
- the contextprotected JCalValue _writeJson(ExceptionDates property, WriteContext context)
ICalPropertyScribe
Marshals a property's value to a JSON data stream (jCal).
This method should be overridden by child classes that wish to support
jCal. The default implementation of this method will create a jCard
property that has a single JSON string value (generated by the
ICalPropertyScribe.writeText(T, biweekly.io.WriteContext)
method).
_writeJson
in class ListPropertyScribe<ExceptionDates,ICalDate>
property
- the propertycontext
- the contextprotected ExceptionDates _parseJson(JCalValue value, ICalDataType dataType, ICalParameters parameters, ParseContext context)
ICalPropertyScribe
Unmarshals a property from a JSON data stream (jCal).
This method should be overridden by child classes that wish to support
jCal. The default implementation of this method will convert the jCal
property value to a string and pass it into the ICalPropertyScribe._parseText(java.lang.String, biweekly.ICalDataType, biweekly.parameter.ICalParameters, biweekly.io.ParseContext)
method.
The following paragraphs describe the way in which this method's default implementation converts a jCal value to a string:
If the jCal value consists of a single, non-array, non-object value, then
the value is converted to a string. Special characters (backslashes,
commas, and semicolons) are escaped in order to simulate what the value
might look like in a plain-text iCalendar object.
["x-foo", {}, "text", "the;value"] --> "the\;value"
["x-foo", {}, "text", 2] --> "2"
If the jCal value consists of multiple, non-array, non-object values,
then all the values are appended together in a single string, separated
by commas. Special characters (backslashes, commas, and semicolons) are
escaped for each value in order to prevent commas from being treated as
delimiters, and to simulate what the value might look like in a
plain-text iCalendar object.
["x-foo", {}, "text", "one", "two,three"] -->
"one,two\,three"
If the jCal value is a single array, then this array is treated as a
"structured value", and converted its plain-text representation. Special
characters (backslashes, commas, and semicolons) are escaped for each
value in order to prevent commas and semicolons from being treated as
delimiters.
["x-foo", {}, "text", ["one", ["two", "three"], "four;five"]]
--> "one;two,three;four\;five"
If the jCal value starts with a JSON object, then the object is converted
to a format identical to the one used in the RRULE and EXRULE properties.
Special characters (backslashes, commas, semicolons, and equal signs) are
escaped for each value in order to preserve the syntax of the string
value.
["x-foo", {}, "text", {"one": 1, "two": [2, 2.5]}] --> "ONE=1;TWO=2,2.5"
For all other cases, behavior is undefined.
_parseJson
in class ListPropertyScribe<ExceptionDates,ICalDate>
value
- the property's JSON valuedataType
- the data typeparameters
- 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.context
- the contextCopyright © 2013-2015 Michael Angstadt. All Rights Reserved.