当前位置: 首页>>代码示例>>Java>>正文


Java VCardEngine类代码示例

本文整理汇总了Java中net.sourceforge.cardme.engine.VCardEngine的典型用法代码示例。如果您正苦于以下问题:Java VCardEngine类的具体用法?Java VCardEngine怎么用?Java VCardEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VCardEngine类属于net.sourceforge.cardme.engine包,在下文中一共展示了VCardEngine类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readDetailsFromvCard

import net.sourceforge.cardme.engine.VCardEngine; //导入依赖的package包/类
/**
 * Parses the details from the specified vCard string and adds them to the right
 * details lists.
 *
 * @param vCardEngine   The vCard parsing engine to use
 * @param vCardString   The vCard contents as a string
 * @param names         The "formatted names" list
 * @param emails        The "email addresses" list
 * @param organizations The "organization names" list
 * @param titles        The "titles" list
 *
 * @throws IOException Thrown if the vCard string is malformed
 */
private static void readDetailsFromvCard(VCardEngine vCardEngine, String vCardString, ArrayList<String> names,
                                         ArrayList<String> emails, ArrayList<String> organizations,
                                         ArrayList<String> titles) throws IOException {

    String tmp;
    VCard vCard = vCardEngine.parse(vCardString);

    // Read the formatted name and title from the vCard first
    if (vCard.getFormattedName() != null) {
        tmp = vCard.getFormattedName().getFormattedName();
        names.add(tmp);
        if (DEBUG) Log.v(TAG, "Tag formatted name: " + tmp);
    }

    if (vCard.getTitle() != null) {
        tmp = vCard.getTitle().getTitle();
        titles.add(tmp);
        if (DEBUG) Log.v(TAG, "Tag title: " + tmp);
    }

    // Read the emails and organizations (there can be more than one per vCard)
    if (vCard.getEmails() != null) {
        final Iterator<EmailFeature> emailIterator = vCard.getEmails();
        while (emailIterator.hasNext()) {
            tmp = emailIterator.next().getEmail();
            emails.add(tmp);
            if (DEBUG) Log.v(TAG, "Tag email: " + tmp);
        }
    }

    if (vCard.getOrganizations() != null && vCard.getOrganizations().getOrganizations() != null) {
        final Iterator<String> orgsIterator = vCard.getOrganizations().getOrganizations();
        while (orgsIterator.hasNext()) {
            tmp = orgsIterator.next();
            organizations.add(tmp);
            if (DEBUG) Log.v(TAG, "Tag organization: " + tmp);
        }
    }
}
 
开发者ID:imspa,项目名称:NFC-Lottery,代码行数:53,代码来源:MainActivity.java

示例2: VCarder

import net.sourceforge.cardme.engine.VCardEngine; //导入依赖的package包/类
public VCarder() {
    vcardEngine = new VCardEngine();
    vcard = new VCardImpl();
    writer = new VCardWriter();
}
 
开发者ID:cognitivabrasil,项目名称:obaa,代码行数:6,代码来源:VCarder.java


注:本文中的net.sourceforge.cardme.engine.VCardEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。