public abstract class VCardProperty extends Object implements Comparable<VCardProperty>
Modifier and Type | Field and Description |
---|---|
protected String |
group
The group that this property belongs to or null if it doesn't belong to a
group.
|
protected VCardParameters |
parameters
The property's parameters.
|
Constructor and Description |
---|
VCardProperty() |
Modifier and Type | Method and Description |
---|---|
protected Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property.
|
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
void |
addParameter(String name,
String value)
Adds a value to a parameter.
|
int |
compareTo(VCardProperty that)
Sorts by PREF parameter ascending.
|
String |
getGroup()
Gets this property's group.
|
String |
getParameter(String name)
Gets the first value of a parameter.
|
VCardParameters |
getParameters()
Gets all of the property's parameters.
|
List<String> |
getParameters(String name)
Gets all values of a parameter.
|
Set<VCardVersion> |
getSupportedVersions()
Gets the vCard versions that support this property.
|
void |
removeParameter(String name)
Removes a parameter from the property.
|
void |
setGroup(String group)
Sets this property's group.
|
void |
setParameter(String name,
String value)
Replaces all existing values of a parameter with the given value.
|
void |
setParameters(VCardParameters parameters)
Sets the property's parameters.
|
List<Warning> |
validate(VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
protected String group
protected VCardParameters parameters
public final Set<VCardVersion> getSupportedVersions()
protected Set<VCardVersion> _supportedVersions()
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.
public final List<Warning> validate(VCardVersion version, VCard vcard)
version
- the version to check the property against (use 4.0 for
xCard and jCard)vcard
- the vCard this property belongs toVCard.validate(org.opencrx.application.uses.ezvcard.VCardVersion)
protected void _validate(List<Warning> warnings, VCardVersion version, VCard vcard)
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs topublic VCardParameters getParameters()
public void setParameters(VCardParameters parameters)
parameters
- the parameterspublic String getParameter(String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public List<String> getParameters(String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public void setParameter(String name, String value)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")value
- the parameter valuepublic void addParameter(String name, String value)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")value
- the parameter valuepublic void removeParameter(String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public String getGroup()
public void setGroup(String group)
group
- the group or null to remove the property's grouppublic int compareTo(VCardProperty that)
compareTo
in interface Comparable<VCardProperty>
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.