Methods Summary |
---|
protected java.lang.String | getBinaryEncodingName()Gets the binary encoding name.
return "B";
|
protected java.lang.String | getCategoryProperty()Gets the category property name.
return "CATEGORY";
|
protected java.lang.String | getClassProperty()Gets the class property name.
return "CLASS";
|
protected java.lang.String | getVersion()Gets the VCard version number.
return "3.0";
|
protected int | parseAttributes(java.lang.String[] attributes)Get the binary value describing all flags in a vCard line.
int code = 0;
for (int i = 0; i < attributes.length; i++) {
if (attributes[i].startsWith("TYPE=")) {
String[] s = FormatSupport.split(attributes[i], ',", 5);
for (int j = 0; j < s.length; j++) {
code |= VCardSupport.getAttributeCode(s[j], 0);
}
} else {
code |= VCardSupport.getAttributeCode(attributes[i], 0);
}
}
return code;
|
protected void | writeAttributes(java.io.Writer w, int attributes)Writes the attributes for a field.
boolean writtenData = false;
for (int i = 0; i < 32; i++) {
long mask = 1l << i;
if ((attributes & mask) != 0) {
String attributeLabel =
VCardSupport.getAttributeLabel((int) mask);
if (attributeLabel != null) {
if (writtenData) {
w.write(",");
} else {
w.write(";TYPE=");
writtenData = true;
}
w.write(attributeLabel);
}
}
}
|