public abstract class VCardProperty extends java.lang.Object implements java.lang.Comparable<VCardProperty>
Modifier and Type | Field and Description |
---|---|
protected java.lang.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 java.util.Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property.
|
protected void |
_validate(java.util.List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
void |
addParameter(java.lang.String name,
java.lang.String value)
Adds a value to a parameter.
|
int |
compareTo(VCardProperty that)
Sorts by PREF parameter ascending.
|
java.lang.String |
getGroup()
Gets this property's group.
|
java.lang.String |
getParameter(java.lang.String name)
Gets the first value of a parameter.
|
VCardParameters |
getParameters()
Gets all of the property's parameters.
|
java.util.List<java.lang.String> |
getParameters(java.lang.String name)
Gets all values of a parameter.
|
java.util.Set<VCardVersion> |
getSupportedVersions()
Gets the vCard versions that support this property.
|
void |
removeParameter(java.lang.String name)
Removes a parameter from the property.
|
void |
setGroup(java.lang.String group)
Sets this property's group.
|
void |
setParameter(java.lang.String name,
java.lang.String value)
Replaces all existing values of a parameter with the given value.
|
void |
setParameters(VCardParameters parameters)
Sets the property's parameters.
|
java.util.List<Warning> |
validate(VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
protected java.lang.String group
protected VCardParameters parameters
public final java.util.Set<VCardVersion> getSupportedVersions()
protected java.util.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 java.util.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(java.util.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 java.lang.String getParameter(java.lang.String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public java.util.List<java.lang.String> getParameters(java.lang.String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public void setParameter(java.lang.String name, java.lang.String value)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")value
- the parameter valuepublic void addParameter(java.lang.String name, java.lang.String value)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")value
- the parameter valuepublic void removeParameter(java.lang.String name)
name
- the parameter name (case insensitive, e.g. "LANGUAGE")public java.lang.String getGroup()
public void setGroup(java.lang.String group)
group
- the group or null to remove the property's grouppublic int compareTo(VCardProperty that)
compareTo
in interface java.lang.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.