public class AgentScribe extends VCardPropertyScribe<Agent>
Agent
properties.VCardPropertyScribe.DateWriter
clazz, propertyName, qname
Constructor and Description |
---|
AgentScribe() |
Modifier and Type | Method and Description |
---|---|
protected VCardDataType |
_dataType(Agent property,
VCardVersion version)
Determines the data type of a property instance.
|
protected VCardDataType |
_defaultDataType(VCardVersion version)
Determines the property's default data type.
|
protected Agent |
_parseHtml(HCardElement element,
ParseContext context)
Unmarshals the property from an hCard (HTML document).
|
protected Agent |
_parseText(String value,
VCardDataType dataType,
VCardParameters parameters,
ParseContext context)
Unmarshals a property from a plain-text vCard.
|
protected String |
_writeText(Agent property,
WriteContext context)
Marshals a property's value to a string.
|
_parseJson, _parseXml, _prepareParameters, _writeJson, _writeXml, dataType, date, date, defaultDataType, escape, getPropertyClass, getPropertyName, getQName, handlePrefParam, missingXmlElements, missingXmlElements, parseHtml, parseJson, parseText, parseXml, prepareParameters, writeJson, writeText, writeXml
public AgentScribe()
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, 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, ezvcard.VCardDataType, ezvcard.parameter.VCardParameters, ezvcard.io.ParseContext)
method.
_defaultDataType
in class VCardPropertyScribe<Agent>
version
- the vCard versionprotected VCardDataType _dataType(Agent 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(ezvcard.VCardVersion)
.
_dataType
in class VCardPropertyScribe<Agent>
property
- the propertyversion
- the version of the vCard that is being generatedprotected String _writeText(Agent property, WriteContext context)
VCardPropertyScribe
_writeText
in class VCardPropertyScribe<Agent>
property
- the propertycontext
- contains information about the vCard being written, such
as the target versionprotected Agent _parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context)
VCardPropertyScribe
_parseText
in class VCardPropertyScribe<Agent>
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(ezvcard.VCardVersion)
method.
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.context
- the parse contextprotected Agent _parseHtml(HCardElement element, ParseContext context)
VCardPropertyScribe
Unmarshals the property from an hCard (HTML document).
This method should be overridden by child classes that wish to support
hCard. The default implementation of this method will retrieve the HTML
element's hCard value (as described in HCardElement.value()
), and
pass it into the VCardPropertyScribe._parseText(java.lang.String, ezvcard.VCardDataType, ezvcard.parameter.VCardParameters, ezvcard.io.ParseContext)
method.
_parseHtml
in class VCardPropertyScribe<Agent>
element
- the property's HTML elementcontext
- the parse contextCopyright © 2012–2023 Michael Angstadt. All rights reserved.