public class RawPropertyScribe extends VCardPropertyScribe<RawProperty>
RawProperty
properties.VCardPropertyScribe.DateWriter, VCardPropertyScribe.Result<T extends VCardProperty>, VCardPropertyScribe.SemiStructuredIterator, VCardPropertyScribe.Splitter, VCardPropertyScribe.StructuredIterator
clazz, propertyName, qname
Constructor and Description |
---|
RawPropertyScribe(String propertyName) |
Modifier and Type | Method and Description |
---|---|
protected VCardDataType |
_dataType(RawProperty property,
VCardVersion version)
Determines the data type of a property instance.
|
protected VCardDataType |
_defaultDataType(VCardVersion version)
Determines the property's default data type.
|
protected RawProperty |
_parseText(String value,
VCardDataType dataType,
VCardVersion version,
VCardParameters parameters,
List<String> warnings)
Unmarshals a property from a plain-text vCard.
|
protected String |
_writeText(RawProperty property,
VCardVersion version)
Marshals a property's value to a string.
|
_parseXml, _prepareParameters, _writeXml, dataType, date, date, defaultDataType, escape, getPropertyClass, getPropertyName, getQName, handlePrefParam, list, list, list, missingXmlElements, missingXmlElements, parseText, parseXml, prepareParameters, semistructured, semistructured, splitter, structured, structured, unescape, writeText, writeXml
public RawPropertyScribe(String propertyName)
protected VCardDataType _defaultDataType(VCardVersion version)
VCardPropertyScribe
Determines the property's default data type.
When writing a plain-text vCard, if the data type of a property instance
(as determined by the VCardPropertyScribe.dataType(T, org.opencrx.application.uses.ezvcard.VCardVersion)
method) matches the default data
type, then a VALUE parameter will *not* be written.
When parsing a plain-text vCard, if a property has no VALUE parameter,
then the property's default data type will be passed into the
VCardPropertyScribe.parseText(java.lang.String, org.opencrx.application.uses.ezvcard.VCardDataType, org.opencrx.application.uses.ezvcard.VCardVersion, org.opencrx.application.uses.ezvcard.parameter.VCardParameters)
method.
_defaultDataType
in class VCardPropertyScribe<RawProperty>
version
- the vCard versionprotected VCardDataType _dataType(RawProperty property, VCardVersion version)
VCardPropertyScribe
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 calls VCardPropertyScribe._defaultDataType(org.opencrx.application.uses.ezvcard.VCardVersion)
.
_dataType
in class VCardPropertyScribe<RawProperty>
property
- the propertyversion
- the version of the vCard that is being generatedprotected String _writeText(RawProperty property, VCardVersion version)
VCardPropertyScribe
_writeText
in class VCardPropertyScribe<RawProperty>
property
- the propertyversion
- the version of the vCard that is being generatedprotected RawProperty _parseText(String value, VCardDataType dataType, VCardVersion version, VCardParameters parameters, List<String> warnings)
VCardPropertyScribe
_parseText
in class VCardPropertyScribe<RawProperty>
value
- the value as read off the wiredataType
- 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, as determined by the VCardPropertyScribe.defaultDataType(org.opencrx.application.uses.ezvcard.VCardVersion)
method.
Note that the VALUE parameter is removed from the property's parameter
list after it has been read.version
- the version of the vCard that is being parsedparameters
- 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 processThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.