Search in sources :

Example 1 with XCardDocument

use of ezvcard.io.xml.XCardDocument in project ez-vcard by mangstadt.

the class ChainingXmlWriter method createXCardDocument.

private XCardDocument createXCardDocument() {
    XCardDocument document = new XCardDocument();
    XCardDocumentStreamWriter writer = document.writer();
    writer.setAddProdId(prodId);
    writer.setVersionStrict(versionStrict);
    for (Map.Entry<String, VCardDataType> entry : parameterDataTypes.entrySet()) {
        String parameterName = entry.getKey();
        VCardDataType dataType = entry.getValue();
        writer.registerParameterDataType(parameterName, dataType);
    }
    if (index != null) {
        writer.setScribeIndex(index);
    }
    for (VCard vcard : vcards) {
        writer.write(vcard);
    }
    return document;
}
Also used : XCardDocument(ezvcard.io.xml.XCardDocument) XCardDocumentStreamWriter(ezvcard.io.xml.XCardDocument.XCardDocumentStreamWriter) HashMap(java.util.HashMap) Map(java.util.Map) VCardDataType(ezvcard.VCardDataType) VCard(ezvcard.VCard)

Aggregations

VCard (ezvcard.VCard)1 VCardDataType (ezvcard.VCardDataType)1 XCardDocument (ezvcard.io.xml.XCardDocument)1 XCardDocumentStreamWriter (ezvcard.io.xml.XCardDocument.XCardDocumentStreamWriter)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1