public class Label extends TextProperty
Defines the exact text to put on the mailing label when sending snail mail to
the person. Note that instances of this class should NEVER be added to a
vCard! Instead, use the Address.setLabel(java.lang.String)
method to assign a mailing
label to an Address
property.
Version interoperability
The label property is not supported in vCard version 4.0. Instead, labels are
included as parameters to their corresponding Address
properties. When marshalling a vCard, ez-vcard will use either the label
property or the LABEL parameter, depending on the requested vCard version.
Orphaned labels
ez-vcard defines an "orphaned label" as a label property that could not be
assigned to an address (a label is assigned to an address if its list of TYPE
parameters is identical to the address's list of TYPE parameters). The
VCard.addOrphanedLabel(org.opencrx.application.uses.ezvcard.property.Label)
method can be used to add such labels to a
vCard, but its use is strongly discouraged. The
VCard.getOrphanedLabels()
method can be useful when parsing version 2.1
or 3.0 vCards in order to retrieve any label properties that the parser could
not assign to an address.
Property name: LABEL
Supported versions: 2.1, 3.0
value
group, parameters
Constructor and Description |
---|
Label(String label)
Creates a label property.
|
Modifier and Type | Method and Description |
---|---|
Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property.
|
void |
addType(AddressType type)
Adds a TYPE parameter.
|
String |
getLanguage()
Gets the language that the property value is written in.
|
Set<AddressType> |
getTypes()
Gets all the TYPE parameters.
|
void |
removeType(AddressType type)
Removes a TYPE parameter.
|
void |
setLanguage(String language)
Sets the language that the property value is written in.
|
_validate, getValue, setValue
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate
public Label(String label)
label
- the label valuepublic Set<VCardVersion> _supportedVersions()
VCardProperty
Gets the vCard versions that support this property.
This method should be overridden by child classes if the property does not support all vCard versions. The default implementation of this method returns all vCard versions.
_supportedVersions
in class VCardProperty
public Set<AddressType> getTypes()
public void addType(AddressType type)
type
- the TYPE parameter to addpublic void removeType(AddressType type)
type
- the TYPE parameter to removepublic String getLanguage()
VCardProperty
VCardParameters.getLanguage()
public void setLanguage(String language)
VCardProperty
language
- the language or null to removeVCardParameters.setLanguage(java.lang.String)
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.