VCardPropertypublic class VCardProperty extends Object Represents vCard's property, or logical "one line" of each vCard entry.
e.g.
Given a vCard below, objects for N:name , TEL:1111111111 are
"property".
BEGIN:VCARD
N:name
TEL:1111111111
END:VCARD
vCard's property has three elements: name, parameter (or param), and value. Name is the name
of each property. Parameter or param is additional information for the property. Value is one
or multiple values representing the parameter.
e.g.
N;CHARSET=UTF-8:Joe;Due;M.;Mr.;Ph.D. , has "N" for name, "CHALSET=UTF-8" for param,
and "Joe;Due;M.;Mr.;Ph.D." for value.
Usually params are represented as "key=value" pair, but not always
(The property TEL;WORK;VOICE:(111) 555-1212 has two params without key "TYPE",
which are same as "TYPE=WORK" and "TYPE=VOICE". In vCard 3.0, we can even express them as
"TYPE=WORK,VOICE").
Sometimes (not always) value can be separated by semi-colon. In the example above "Joe;Due;;;"
should be interpreted as five strings: "Joe" (for family name), "Due" (for given name), "M."
(for middle name), "Mr." (for prefix), and "Ph.D." (for suffix). Whether the value is
separable or not is specified by vCard specs. |
Fields Summary |
---|
private static final String | LOG_TAG | private String | mName | private List | mGroupList | private Map | mParameterMap | private String | mRawValue | private List | mValueList | private byte[] | mByteValue |
Methods Summary |
---|
public void | addGroup(java.lang.String group)
if (mGroupList == null) {
mGroupList = new ArrayList<String>();
}
mGroupList.add(group);
| public void | addParameter(java.lang.String paramName, java.lang.String paramValue)
Collection<String> values;
if (!mParameterMap.containsKey(paramName)) {
if (paramName.equals("TYPE")) {
values = new HashSet<String>();
} else {
values = new ArrayList<String>();
}
mParameterMap.put(paramName, values);
} else {
values = mParameterMap.get(paramName);
}
values.add(paramValue);
| public void | addValues(java.lang.String propertyValues)
if (mValueList == null) {
mValueList = Arrays.asList(propertyValues);
} else {
mValueList.addAll(Arrays.asList(propertyValues));
}
| public void | addValues(java.util.List propertyValueList)
if (mValueList == null) {
mValueList = new ArrayList<String>(propertyValueList);
} else {
mValueList.addAll(propertyValueList);
}
| public byte[] | getByteValue()
return mByteValue;
| public java.util.List | getGroupList()
return mGroupList;
| public java.lang.String | getName()
return mName;
| public java.util.Map | getParameterMap()
return mParameterMap;
| public java.util.Collection | getParameters(java.lang.String type)
return mParameterMap.get(type);
| public java.lang.String | getRawValue()
return mRawValue;
| public java.util.List | getValueList()
return mValueList;
| public void | setByteValue(byte[] byteValue)
mByteValue = byteValue;
| public void | setName(java.lang.String name)
if (mName != null) {
Log.w(LOG_TAG, String.format("Property name is re-defined " +
"(existing: %s, requested: %s", mName, name));
}
mName = name;
| public void | setParameter(java.lang.String paramName, java.lang.String paramValue)
mParameterMap.clear();
addParameter(paramName, paramValue);
| public void | setRawValue(java.lang.String rawValue)
mRawValue = rawValue;
| public void | setValues(java.lang.String propertyValues)
mValueList = Arrays.asList(propertyValues);
| public void | setValues(java.util.List propertyValueList)
mValueList = propertyValueList;
|
|