Search in sources :

Example 6 with LuckyNumProperty

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

the class EzvcardTest method parseXml_register.

@Test
public void parseXml_register() throws Exception {
    XCardBuilder xb = new XCardBuilder();
    xb.prop("http://luckynum.com", "lucky-num", "<num>22</num>");
    VCard vcard = Ezvcard.parseXml(xb.toString()).register(new LuckyNumScribe()).first();
    assertVersion(VCardVersion.V4_0, vcard);
    List<LuckyNumProperty> ext = vcard.getProperties(LuckyNumProperty.class);
    assertEquals(1, ext.size());
    assertEquals(22, ext.get(0).luckyNum);
}
Also used : LuckyNumScribe(ezvcard.io.LuckyNumProperty.LuckyNumScribe) XCardBuilder(ezvcard.util.XCardBuilder) LuckyNumProperty(ezvcard.io.LuckyNumProperty) Test(org.junit.Test)

Aggregations

LuckyNumProperty (ezvcard.io.LuckyNumProperty)6 LuckyNumScribe (ezvcard.io.LuckyNumProperty.LuckyNumScribe)6 Test (org.junit.Test)6 VCard (ezvcard.VCard)5 AgeProperty (ezvcard.io.AgeProperty)3 AgeScribe (ezvcard.io.AgeProperty.AgeScribe)3 SalaryProperty (ezvcard.io.SalaryProperty)3 SalaryScribe (ezvcard.io.SalaryProperty.SalaryScribe)3 RawProperty (ezvcard.property.RawProperty)2 VCardVersion (ezvcard.VCardVersion)1 MyFormattedNameProperty (ezvcard.io.MyFormattedNameProperty)1 MyFormattedNameScribe (ezvcard.io.MyFormattedNameProperty.MyFormattedNameScribe)1 XCardDocumentStreamWriter (ezvcard.io.xml.XCardDocument.XCardDocumentStreamWriter)1 Xml (ezvcard.property.Xml)1 XCardBuilder (ezvcard.util.XCardBuilder)1 Document (org.w3c.dom.Document)1