|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiweekly.property.marshaller.ICalPropertyMarshaller<T>
public abstract class ICalPropertyMarshaller<T extends ICalProperty>
Base class for iCalendar property marshallers.
| Nested Class Summary | |
|---|---|
protected static class |
ICalPropertyMarshaller.DateParser
Factory class for parsing dates. |
protected static class |
ICalPropertyMarshaller.DateWriter
Factory class for writing dates. |
static class |
ICalPropertyMarshaller.Result<T>
Represents the result of a marshal or unmarshal operation. |
protected static class |
ICalPropertyMarshaller.Splitter
Factory class for splitting strings. |
| Field Summary | |
|---|---|
protected Class<T> |
clazz
|
protected String |
propertyName
|
protected QName |
qname
|
| Constructor Summary | |
|---|---|
ICalPropertyMarshaller(Class<T> clazz,
String propertyName)
Creates a new marshaller. |
|
ICalPropertyMarshaller(Class<T> clazz,
String propertyName,
QName qname)
Creates a new marshaller. |
|
| Method Summary | |
|---|---|
protected abstract 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 abstract String |
_writeText(T property)
Marshals a property's value to a string. |
protected void |
_writeXml(T property,
XCalElement element)
Marshals a property's value to an XML element (xCal). |
protected static ICalPropertyMarshaller.DateWriter |
date(Date date)
Formats a Date object as a string. |
protected static ICalPropertyMarshaller.DateParser |
date(String value)
Parses a date string. |
protected static String |
escape(String text)
Escapes all special characters within a iCalendar value. |
Class<T> |
getPropertyClass()
Gets the property class. |
String |
getPropertyName()
Gets the property name. |
QName |
getQName()
Gets this property's local name and namespace for xCal documents. |
protected static String[][] |
parseComponent(String str)
Parses a component value. |
protected static String[] |
parseList(String str)
Parses a comma-separated list of values. |
ICalPropertyMarshaller.Result<T> |
parseText(String value,
ICalParameters parameters)
Unmarshals a property's value. |
ICalPropertyMarshaller.Result<T> |
parseXml(Element element,
ICalParameters parameters)
Unmarshals a property's value from an XML document (xCal). |
ICalParameters |
prepareParameters(T property)
Sanitizes a property's parameters (called before the property is written). |
protected static ICalPropertyMarshaller.Splitter |
split(String string,
String delimiter)
Splits a string by a delimiter. |
protected static String |
unescape(String text)
Unescapes all special characters that are escaped with a backslash, as well as escaped newlines. |
String |
writeText(T property)
Marshals a property's value to a string. |
void |
writeXml(T property,
Element element)
Marshals a property's value to an XML element (xCal). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<T extends ICalProperty> clazz
protected final String propertyName
protected final QName qname
| Constructor Detail |
|---|
public ICalPropertyMarshaller(Class<T> clazz,
String propertyName)
clazz - the property classpropertyName - the property name (e.g. "VERSION")
public ICalPropertyMarshaller(Class<T> clazz,
String propertyName,
QName qname)
clazz - the property classpropertyName - the property name (e.g. "VERSION")qname - the XML element name and namespace (used for xCal documents)| Method Detail |
|---|
public Class<T> getPropertyClass()
public String getPropertyName()
public QName getQName()
public final ICalParameters prepareParameters(T property)
property - the property
public final String writeText(T property)
property - the property
SkipMeException - if the property should not be written to the data
stream
public final void writeXml(T property,
Element element)
property - the propertyelement - the property's XML element
SkipMeException - if the property should not be written to the data
stream
public final ICalPropertyMarshaller.Result<T> parseText(String value,
ICalParameters parameters)
value - the valueparameters - the property's parameters
CannotParseException - if the marshaller could not parse the
property's value
SkipMeException - if the property should not be added to the final
ICalendar object
public final ICalPropertyMarshaller.Result<T> parseXml(Element element,
ICalParameters parameters)
element - the property's XML elementparameters - the property's parameters
CannotParseException - if the marshaller could not parse the
property's value
SkipMeException - if the property should not be added to the final
ICalendar object
protected void _prepareParameters(T property,
ICalParameters copy)
property - the propertycopy - the list of parameters to make modifications to (it is a copy
of the property's parameters)protected abstract String _writeText(T property)
property - the property
SkipMeException - if the property should not be written to the data
stream
protected void _writeXml(T property,
XCalElement element)
property - the propertyelement - the XML element
SkipMeException - if the property should not be written to the data
stream
protected abstract T _parseText(String value,
ICalParameters parameters,
List<String> warnings)
value - the valueparameters - the property's parameterswarnings - allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
unmarshalling process
CannotParseException - if the marshaller could not parse the
property's value
SkipMeException - if the property should not be added to the final
ICalendar object
protected T _parseXml(XCalElement element,
ICalParameters parameters,
List<String> warnings)
element - the property's XML elementparameters - the property's parameterswarnings - allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
unmarshalling process
CannotParseException - if the marshaller could not parse the
property's value
SkipMeException - if the property should not be added to the final
ICalendar objectprotected static String unescape(String text)
text - the text to unescape
protected static String escape(String text)
These characters are:
\),);)ICalWriter)
text - the text to escape
protected static ICalPropertyMarshaller.Splitter split(String string,
String delimiter)
string - the string to split (e.g. "one,two,three")delimiter - the delimiter (e.g. ",")
protected static String[] parseList(String str)
str - the string to parse (e.g. "one,two,th\,ree")
protected static String[][] parseComponent(String str)
str - the string to parse (e.g. "one;two,three;four")
protected static ICalPropertyMarshaller.DateParser date(String value)
value - the date string
protected static ICalPropertyMarshaller.DateWriter date(Date date)
Date object as a string.
date - the date
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||