|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.util.ListMultimap<String,String>
ezvcard.parameter.VCardParameters
public class VCardParameters
Holds the parameters (aka "sub types") of a vCard property.
Field Summary | |
---|---|
static String |
ALTID
|
static String |
CALSCALE
|
static String |
CHARSET
|
static String |
ENCODING
|
static String |
GEO
|
static String |
INDEX
|
static String |
LABEL
|
static String |
LANGUAGE
|
static String |
LEVEL
|
static String |
MEDIATYPE
|
static String |
PID
|
static String |
PREF
|
static String |
SORT_AS
|
static String |
TYPE
|
static String |
TZ
|
static String |
VALUE
|
Constructor Summary | |
---|---|
VCardParameters()
Creates a list of parameters. |
|
VCardParameters(VCardParameters orig)
Creates a copy of an existing parameter list. |
Method Summary | |
---|---|
void |
addPid(int localId)
Adds a PID parameter value. |
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID parameter value. |
void |
addType(String type)
Adds a TYPE parameter. |
String |
getAltId()
Gets the ALTID parameter value. |
Calscale |
getCalscale()
Gets the type of calendar that is used for a date or date-time property value. |
String |
getCharset()
Gets the CHARSET parameter. |
Encoding |
getEncoding()
Gets the ENCODING parameter. |
double[] |
getGeo()
Gets the GEO parameter value. |
Integer |
getIndex()
Gets the sorted position of this property when it is grouped together with other properties of the same type. |
String |
getLabel()
Gets the LABEL parameter. |
String |
getLanguage()
Gets the LANGUAGE parameter. |
String |
getLevel()
Gets the LEVEL parameter. |
String |
getMediaType()
Gets the MEDIATYPE parameter. |
List<Integer[]> |
getPids()
Gets all PID parameter values. |
Integer |
getPref()
Gets the preference value. |
List<String> |
getSortAs()
Gets the SORT-AS parameter value(s). |
String |
getTimezone()
Gets the TZ parameter. |
String |
getType()
Gets the first TYPE parameter. |
Set<String> |
getTypes()
Gets all TYPE parameters. |
VCardDataType |
getValue()
Gets the VALUE parameter. |
void |
removePids()
Removes all PID values. |
void |
removeType(String type)
Removes a TYPE parameter. |
void |
removeTypes()
Removes all TYPE parameters. |
void |
removeValue()
Removes the VALUE parameter. |
protected String |
sanitizeKey(String key)
Modifies a given key before it is used to interact with the internal map. |
void |
setAltId(String altId)
Sets the ALTID parameter value. |
void |
setCalscale(Calscale value)
Sets the type of calendar that is used for a date or date-time property value. |
void |
setCharset(String charset)
Sets the CHARSET parameter. |
void |
setEncoding(Encoding encoding)
Sets the ENCODING parameter. |
void |
setGeo(double latitude,
double longitude)
Sets the GEO parameter value. |
void |
setIndex(Integer index)
Sets the sorted position of this property when it is grouped together with other properties of the same type. |
void |
setLabel(String label)
Sets the LABEL parameter. |
void |
setLanguage(String language)
Sets the LANGUAGE parameter. |
void |
setLevel(String level)
Sets the LEVEL parameter. |
void |
setMediaType(String mediaType)
Sets the MEDIATYPE parameter. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setSortAs(String... names)
Sets the SORT-AS parameter value(s). |
void |
setTimezone(String tz)
Sets the TZ parameter. |
void |
setType(String type)
Sets the TYPE parameter. |
void |
setValue(VCardDataType value)
Sets the VALUE parameter. |
List<Warning> |
validate(VCardVersion version)
Checks this parameters list for data consistency problems or deviations from the spec. |
Methods inherited from class ezvcard.util.ListMultimap |
---|
clear, containsKey, equals, first, get, getMap, hashCode, isEmpty, iterator, keySet, put, putAll, remove, removeAll, replace, replace, size, toString, values |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ALTID
public static final String CALSCALE
public static final String CHARSET
public static final String ENCODING
public static final String GEO
public static final String INDEX
public static final String LABEL
public static final String LANGUAGE
public static final String LEVEL
public static final String MEDIATYPE
public static final String PID
public static final String PREF
public static final String SORT_AS
public static final String TYPE
public static final String TZ
public static final String VALUE
Constructor Detail |
---|
public VCardParameters()
public VCardParameters(VCardParameters orig)
orig
- the object to copyMethod Detail |
---|
public Encoding getEncoding()
Gets the ENCODING parameter. This is used when the property value is encoded in a form other than plain text.
Supported versions: 2.1, 3.0
public void setEncoding(Encoding encoding)
Sets the ENCODING parameter. This is used when the property value is encoded in a form other than plain text.
Supported versions: 2.1, 3.0
encoding
- the encoding or null to removepublic VCardDataType getValue()
Gets the VALUE parameter. This defines what kind of data type the property has, such as "text" or "URI". Only used in text-based vCards.
Supported versions: 2.1, 3.0, 4.0
public void setValue(VCardDataType value)
Sets the VALUE parameter. This defines what kind of data type the property has, such as "text" or "URI". Only used in text-based vCards.
Supported versions: 2.1, 3.0, 4.0
value
- the value or null to removepublic void removeValue()
Removes the VALUE parameter. This defines what kind of data type the property has, such as "text" or "URI". Only used in text-based vCards.
Supported versions: 2.1, 3.0, 4.0
public String getCharset()
Gets the CHARSET parameter.
Supported versions: 2.1
public void setCharset(String charset)
Sets the CHARSET parameter.
Supported versions: 2.1
charset
- the value or null to removepublic String getLanguage()
Gets the LANGUAGE parameter.
Supported versions: 2.1, 3.0, 4.0
public void setLanguage(String language)
Sets the LANGUAGE parameter.
Supported versions: 2.1, 3.0, 4.0
language
- the language (e.g "en-US") or null to removepublic String getLabel()
Gets the LABEL parameter.
Supported versions: 4.0
public void setLabel(String label)
Sets the LABEL parameter.
Supported versions: 4.0
label
- the address label or null to removepublic String getTimezone()
Gets the TZ parameter.
Supported versions: 4.0
public void setTimezone(String tz)
Sets the TZ parameter.
Supported versions: 4.0
tz
- the timezone (e.g. "America/New_York") or null to removepublic Set<String> getTypes()
Gets all TYPE parameters.
Supported versions: 2.1, 3.0, 4.0
public void addType(String type)
Adds a TYPE parameter.
Supported versions: 2.1, 3.0, 4.0
type
- the valuepublic String getType()
Gets the first TYPE parameter.
Supported versions: 2.1, 3.0, 4.0
public void setType(String type)
Sets the TYPE parameter.
Supported versions: 2.1, 3.0, 4.0
type
- the value or null to removepublic void removeType(String type)
Removes a TYPE parameter.
Supported versions: 2.1, 3.0, 4.0
type
- the value to removepublic void removeTypes()
Removes all TYPE parameters.
Supported versions: 2.1, 3.0, 4.0
public Integer getPref()
Gets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the address on the second row is the most preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2: ADR;TYPE=work;PREF=1: ADR;TYPE=home:
Preference values must be numeric and must be between 1 and 100.
Supported versions: 4.0
IllegalStateException
- if the parameter value is malformed and
cannot be parsedpublic void setPref(Integer pref)
Sets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the address on the second row is the most preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2: ADR;TYPE=work;PREF=1: ADR;TYPE=home:
Preference values must be numeric and must be between 1 and 100.
Supported versions: 4.0
pref
- the preference value or null to remove
IllegalArgumentException
- if the value is not between 1 and 100public String getAltId()
Gets the ALTID parameter value. This is used to specify alternative representations of the same type.
For example, a vCard may contain multiple NOTE properties that each have the same ALTID. This means that each NOTE contains a different representation of the same information. In the example below, the first three NOTEs have the same ALTID. They each contain the same message, but each is written in a different language. The other NOTEs have different (or absent) ALTIDs, which means they are not associated with the top three.
NOTE;ALTID=1;LANGUAGE=en: Hello world! NOTE;ALTID=1;LANGUAGE=fr: Bonjour tout le monde! NOTE;ALTID=1;LANGUAGE=es: �Hola, mundo! NOTE;ALTID=2;LANGUAGE=de: Meine Lieblingsfarbe ist blau. NOTE;ALTID=2;LANGUAGE=en: My favorite color is blue. NOTE: This vCard will self-destruct in 5 seconds.
Supported versions: 4.0
public void setAltId(String altId)
Sets the ALTID parameter value. This is used to specify alternative representations of the same type.
For example, a vCard may contain multiple NOTE properties that each have the same ALTID. This means that each NOTE contains a different representation of the same information. In the example below, the first three NOTEs have the same ALTID. They each contain the same message, but each is written in a different language. The other NOTEs have different (or absent) ALTIDs, which means they are not associated with the top three.
NOTE;ALTID=1;LANGUAGE=en: Hello world! NOTE;ALTID=1;LANGUAGE=fr: Bonjour tout le monde! NOTE;ALTID=1;LANGUAGE=es: �Hola, mundo! NOTE;ALTID=2;LANGUAGE=de: Meine Lieblingsfarbe ist blau. NOTE;ALTID=2;LANGUAGE=en: My favorite color is blue. NOTE: This vCard will self-destruct in 5 seconds.
Supported versions: 4.0
altId
- the ALTID or null to removepublic double[] getGeo()
Gets the GEO parameter value. This is used to associate global
positioning information with a vCard property. It can be used with the
Address
property.
Supported versions: 4.0
IllegalStateException
- if the parameter value is malformed and
cannot be parsedpublic void setGeo(double latitude, double longitude)
Sets the GEO parameter value. This is used to associate global
positioning information with a vCard property. It can be used with the
Address
property.
Supported versions: 4.0
latitude
- the latitudelongitude
- the longitudepublic List<String> getSortAs()
Gets the SORT-AS parameter value(s). This contains typically two string
values which the vCard should be sorted by (family and given names). This
is useful if the person's last name (defined in the N property) starts
with characters that should be ignored during sorting. It can be used
with the StructuredName
and Organization
properties.
Supported versions: 4.0
public void setSortAs(String... names)
Sets the SORT-AS parameter value(s). This is useful with the N property
when the person's last name starts with characters that should be ignored
during sorting. It can be used with the StructuredName
and
Organization
properties.
Supported versions: 4.0
names
- the names in the order they should be sorted in (e.g.
["Aboville", "Christine"] if the family name is "d'Aboville" and the
given name is "Christine") or empty parameter list to removepublic Calscale getCalscale()
Gets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
public void setCalscale(Calscale value)
Sets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
value
- the type of calendar or null to removepublic List<Integer[]> getPids()
Gets all PID parameter values. PIDs can exist on any property where multiple instances are allowed (such as EMAIL or ADR, but not N because only 1 instance of N is allowed).
When used in conjunction with the CLIENTPIDMAP property, it allows an individual property instance to be uniquely identifiable. This feature is made use of when two different versions of the same vCard have to be merged together (called "synchronizing").
Supported versions: 4.0
IllegalStateException
- if the parameter value is malformed and
cannot be parsedpublic void addPid(int localId)
Adds a PID parameter value. PIDs can exist on any property where multiple instances are allowed (such as EMAIL or ADR, but not N because only 1 instance of N is allowed).
When used in conjunction with the CLIENTPIDMAP property, it allows an individual property instance to be uniquely identifiable. This feature is made use of when two different versions of the same vCard have to be merged together (called "synchronizing").
Supported versions: 4.0
localId
- the local IDpublic void addPid(int localId, int clientPidMapRef)
Adds a PID parameter value. PIDs can exist on any property where multiple instances are allowed (such as EMAIL or ADR, but not N because only 1 instance of N is allowed).
When used in conjunction with the CLIENTPIDMAP property, it allows an individual property instance to be uniquely identifiable. This feature is made use of when two different versions of the same vCard have to be merged together (called "synchronizing").
Supported versions: 4.0
localId
- the local IDclientPidMapRef
- the ID used to reference the property's globally
unique identifier in the CLIENTPIDMAP property.public void removePids()
Removes all PID values.
Supported versions: 4.0
public String getMediaType()
Gets the MEDIATYPE parameter. This is used in properties that have a URL as a value, such as PHOTO and SOUND. It defines the content type of the referenced resource.
Supported versions: 4.0
public void setMediaType(String mediaType)
Sets the MEDIATYPE parameter. This is used in properties that have a URL as a value, such as PHOTO and SOUND. It defines the content type of the referenced resource.
Supported versions: 4.0
mediaType
- the media type (e.g. "image/jpeg") or null to removepublic String getLevel()
Gets the LEVEL parameter. This is used to define the level of skill or level of interest the person has towards something.
Supported versions: 4.0
public void setLevel(String level)
Sets the LEVEL parameter. This is used to define the level of skill or level of interest the person has towards something.
Supported versions: 4.0
level
- the level (e.g. "beginner") or null to removepublic Integer getIndex()
Gets the sorted position of this property when it is grouped together with other properties of the same type. Properties with low index values are put at the beginning of the sorted list and properties with high index values are put at the end of the list.
Supported versions: 4.0
IllegalStateException
- if the parameter value is malformed and
cannot be parsedpublic void setIndex(Integer index)
Sets the sorted position of this property when it is grouped together with other properties of the same type. Properties with low index values are put at the beginning of the sorted list and properties with high index values are put at the end of the list.
Supported versions: 4.0
index
- the INDEX value (must be greater than 0) or null to remove
IllegalArgumentException
- if the value is not greater than 0public List<Warning> validate(VCardVersion version)
version
- the vCard version to validate against
protected String sanitizeKey(String key)
ListMultimap
sanitizeKey
in class ListMultimap<String,String>
key
- the key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |