18 package org.turro.vcard;
20 import java.util.List;
21 import org.turro.contacts.*;
22 import org.turro.contacts.util.MostUsed;
23 import org.turro.elephant.context.ElephantProperties;
24 import org.turro.util.PhraseBuilder;
25 import org.turro.vcard.properties.Property;
26 import org.turro.vcard.properties.PropertyTag;
48 private void generateContact() {
60 PhraseBuilder pb =
new PhraseBuilder();
67 for(Property prop : vCard.
getProperties(PropertyTag.VCP_ADR)) {
71 caddress.
setCity(prop.getValue(3));
79 for(Property prop : vCard.
getProperties(PropertyTag.VCP_EMAIL)) {
87 for(Property prop : vCard.
getProperties(PropertyTag.VCP_TEL)) {
90 if(prop.getTypes().contains(
"CELL")) {
92 }
else if(prop.getTypes().contains(
"FAX")) {
101 for(Property prop : vCard.
getProperties(PropertyTag.VCP_SOURCE)) {
105 connector.
setValue(prop.getValue());
109 for(Property prop : vCard.
getProperties(PropertyTag.VCP_NOTE)) {
116 for(Property prop : vCard.
getProperties(PropertyTag.VCP_TITLE)) {
117 String v[] = prop.getValue().split(
"\\>");
134 }
else if(
matchValue(
"Home",
"Postal", types)) {
137 return types.isEmpty() ?
"***" : types.get(0);
140 public static boolean matchValue(String key, String defaultValue, List<String> types) {
141 for(String p : types) {
143 .matches(
".*(,|^)" + p.toLowerCase() +
"(,|$).*")) {
static String getContextProperty(String context, String property)
void setFull(String full)
List< Property > getProperties(PropertyTag tag)
Property getProperty(PropertyTag tag)