| java.lang.Object com.sun.kvem.midp.pim.formats.EndMatcher com.sun.kvem.midp.pim.formats.VCardFormat
All known Subclasses: com.sun.kvem.midp.pim.formats.VCard30Format, com.sun.kvem.midp.pim.formats.VCard21Format,
VCardFormat | abstract public class VCardFormat extends EndMatcher implements PIMFormat(Code) | | Partial implementation of PIMEncoding for VCard/2.1 and VCard/3.0.
|
Constructor Summary | |
public | VCardFormat() VCard formatting class. |
Method Summary | |
public PIMItem[] | decode(InputStream in, String encoding, PIMList list) Constructs one or more PIMItems from serialized data.
Parameters: in - Stream containing serialized data Parameters: encoding - Character encoding of the stream Parameters: list - PIMList to which items should be added, or null if the itemsshould not be part of a list throws: UnsupportedPIMFormatException - if the serialized data cannot beinterpreted by this encoding. | public void | encode(OutputStream out, String encoding, PIMItem pimItem) Serializes a PIMItem. | abstract protected String | getBinaryEncodingName() Gets the name of the default binary encoding. | abstract protected String | getCategoryProperty() Gets the vCard property name used to store categories. | abstract protected String | getClassProperty() Gets the vCard property name used to store classes. | public String | getName() Gets the code name of this encoding (e.g. | abstract protected String | getVersion() Returns the version number of vCard implemented. | public boolean | isTypeSupported(int pimListType) Checks to see if a given PIM list type is supported by this encoding. | abstract protected int | parseAttributes(String[] attributes) Gets the binary value describing all flags in a vCard line. | abstract protected void | writeAttributes(Writer w, int attributes) Writes the attributes for a field. | protected void | writeDate(Writer w, long date) Writes a vCard date field. | protected void | writeStringArray(Writer w, String[] data) Writes a vCard field with multiple elements, such as ADR. | protected void | writeValue(Writer w, PIMItem item, int field, int index) Writes a single vCard line. |
VCardFormat | public VCardFormat()(Code) | | VCard formatting class.
|
decode | public PIMItem[] decode(InputStream in, String encoding, PIMList list) throws IOException(Code) | | Constructs one or more PIMItems from serialized data.
Parameters: in - Stream containing serialized data Parameters: encoding - Character encoding of the stream Parameters: list - PIMList to which items should be added, or null if the itemsshould not be part of a list throws: UnsupportedPIMFormatException - if the serialized data cannot beinterpreted by this encoding. a non-empty array of PIMItems containing the objects described inthe serialized data, or null if no items are available throws: IOException - if an error occurs while reading |
encode | public void encode(OutputStream out, String encoding, PIMItem pimItem) throws IOException(Code) | | Serializes a PIMItem.
Parameters: out - Stream to which serialized data is written Parameters: encoding - Character encoding to use for serialized data Parameters: pimItem - The item to write to the stream throws: IOException - if an error occurs while writing |
getBinaryEncodingName | abstract protected String getBinaryEncodingName()(Code) | | Gets the name of the default binary encoding.
This is "BASE64" for vCard 2.1 and "B" for vCard 3.0.
the default binary encoding |
getCategoryProperty | abstract protected String getCategoryProperty()(Code) | | Gets the vCard property name used to store categories.
the vCard category property name |
getClassProperty | abstract protected String getClassProperty()(Code) | | Gets the vCard property name used to store classes.
the class property name |
getName | public String getName()(Code) | | Gets the code name of this encoding (e.g. "VCARD/2.1").
the encoding name |
getVersion | abstract protected String getVersion()(Code) | | Returns the version number of vCard implemented.
the VCard version number |
isTypeSupported | public boolean isTypeSupported(int pimListType)(Code) | | Checks to see if a given PIM list type is supported by this encoding.
Parameters: pimListType - int representing the PIM list type to check true if the type can be read and written by this encoding,false otherwise |
parseAttributes | abstract protected int parseAttributes(String[] attributes)(Code) | | Gets the binary value describing all flags in a vCard line.
Parameters: attributes - fields to be parsed binary coded settings |
writeAttributes | abstract protected void writeAttributes(Writer w, int attributes) throws IOException(Code) | | Writes the attributes for a field.
Parameters: w - output stream target Parameters: attributes - data to be written throws: IOException - if an error occurs while writing |
writeDate | protected void writeDate(Writer w, long date) throws IOException(Code) | | Writes a vCard date field.
Parameters: w - output stream target Parameters: date - data to be written throws: IOException - if an error occurs while writing |
writeStringArray | protected void writeStringArray(Writer w, String[] data) throws IOException(Code) | | Writes a vCard field with multiple elements, such as ADR.
Parameters: w - output stream target Parameters: data - the strings to write throws: IOException - if an error occurs while writing |
writeValue | protected void writeValue(Writer w, PIMItem item, int field, int index) throws IOException(Code) | | Writes a single vCard line.
Parameters: w - output stream target Parameters: item - the data to to written Parameters: field - the attribute to be processed Parameters: index - the offset of the data to be processed throws: IOException - if an error occurs while writing |
|
|