Methods Summary |
---|
public static int | getAttributeCode(java.lang.String label, int defaultValue)Lookup the attribute identifier.
if (label.equals("CAR"))
return Contact.ATTR_AUTO;
else if (label.equals("FAX"))
return Contact.ATTR_FAX;
else if (label.equals("HOME"))
return Contact.ATTR_HOME;
else if (label.equals("CELL"))
return Contact.ATTR_MOBILE;
else if (label.equals("X-J2MEWTK-OTHER"))
return Contact.ATTR_OTHER;
else if (label.equals("PAGER"))
return Contact.ATTR_PAGER;
else if (label.equals("PREF"))
return Contact.ATTR_PREFERRED;
else if (label.equals("MSG"))
return Contact.ATTR_SMS;
else if (label.equals("WORK"))
return Contact.ATTR_WORK;
else if (label.equals("X-J2MEWTK-ASST"))
return Contact.ATTR_ASST;
else
return Extensions.getContactAttributeCode(label, defaultValue);
|
public static java.lang.String | getAttributeLabel(int attr)Lookup the attribute name from identifier.
switch (attr) {
case Contact.ATTR_ASST: return "X-J2MEWTK-ASST";
case Contact.ATTR_AUTO: return "CAR";
case Contact.ATTR_FAX: return "FAX";
case Contact.ATTR_HOME: return "HOME";
case Contact.ATTR_MOBILE: return "CELL";
case Contact.ATTR_OTHER: return "X-J2MEWTK-OTHER";
case Contact.ATTR_PAGER: return "PAGER";
case Contact.ATTR_PREFERRED: return "PREF";
case Contact.ATTR_SMS: return "MSG";
case Contact.ATTR_WORK: return "WORK";
default: return Extensions.getContactAttributeLabel(attr);
}
|
public static int | getClassCode(java.lang.String s)Gets the value of the Contact.CLASS field for the given
value of the vCard CLASS property.
This method encapsulates the following mapping:
Contact.CLASS_PUBLIC <- "PUBLIC"
Contact.CLASS_PRIVATE <- "PRIVATE"
Contact.CLASS_CONFIDENTIAL <- "CONFIDENTIAL"
switch (s.length()) {
case 6:
if (s.equals("PUBLIC")) {
return Contact.CLASS_PUBLIC;
}
break;
case 7:
if (s.equals("PRIVATE")) {
return Contact.CLASS_PRIVATE;
}
break;
case 12:
if (s.equals("CONFIDENTIAL")) {
return Contact.CLASS_CONFIDENTIAL;
}
break;
}
return -1;
|
public static java.lang.String | getClassType(int fieldValue)Gets the value of the vCard CLASS field for the given
value of the Contact.CLASS field.
This method encapsulates the following mapping:
Contact.CLASS_PUBLIC -> "PUBLIC"
Contact.CLASS_PRIVATE -> "PRIVATE"
Contact.CLASS_CONFIDENTIAL -> "CONFIDENTIAL"
switch (fieldValue) {
case Contact.CLASS_CONFIDENTIAL: return "CONFIDENTIAL";
case Contact.CLASS_PRIVATE: return "PRIVATE";
case Contact.CLASS_PUBLIC: return "PUBLIC";
}
return null;
|
public static int | getFieldCode(java.lang.String fieldName)Lookup the field identifier byte name.
if (fieldName.equals("FN"))
return Contact.FORMATTED_NAME;
else if (fieldName.equals("LABEL"))
return Contact.FORMATTED_ADDR;
else if (fieldName.equals("ADR"))
return Contact.ADDR;
else if (fieldName.equals("BDAY"))
return Contact.BIRTHDAY;
else if (fieldName.equals("N"))
return Contact.NAME;
else if (fieldName.equals("PHOTO"))
return Contact.PHOTO;
else if (fieldName.equals("TEL"))
return Contact.TEL;
else if (fieldName.equals("TITLE"))
return Contact.TITLE;
else if (fieldName.equals("REV"))
return Contact.REVISION;
else if (fieldName.equals("URL"))
return Contact.URL;
else if (fieldName.equals("UID"))
return Contact.UID;
else if (fieldName.equals("KEY"))
return Contact.PUBLIC_KEY;
else if (fieldName.equals("NICKNAME"))
return Contact.NICKNAME;
else if (fieldName.equals("NOTE"))
return Contact.NOTE;
else if (fieldName.equals("EMAIL"))
return Contact.EMAIL;
else if (fieldName.equals("ORG"))
return Contact.ORG;
else return -1;
|
public static java.lang.String | getFieldLabel(int field)Gets the field label.
switch (field) {
case Contact.FORMATTED_NAME: return "FN";
case Contact.ADDR: return "ADR";
case Contact.BIRTHDAY: return "BDAY";
case Contact.NAME: return "N";
case Contact.PHOTO: return "PHOTO;ENCODING=BASE64";
case Contact.PHOTO_URL: return "PHOTO;VALUE=URL";
case Contact.TEL: return "TEL";
case Contact.TITLE: return "TITLE";
case Contact.REVISION: return "REV";
case Contact.URL: return "URL";
case Contact.UID: return "UID";
case Contact.PUBLIC_KEY: return "KEY;ENCODING=BASE64";
case Contact.FORMATTED_ADDR: return "LABEL";
case Contact.NICKNAME: return "NICKNAME";
case Contact.NOTE: return "NOTE";
case Contact.PUBLIC_KEY_STRING: return "KEY";
case Contact.EMAIL: return "EMAIL";
case Contact.ORG: return "ORG";
default:
return null;
}
|