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


Java Entry.getAuthors方法代码示例

本文整理汇总了Java中com.sun.syndication.feed.atom.Entry.getAuthors方法的典型用法代码示例。如果您正苦于以下问题:Java Entry.getAuthors方法的具体用法?Java Entry.getAuthors怎么用?Java Entry.getAuthors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.syndication.feed.atom.Entry的用法示例。


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

示例1: populateEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
protected void populateEntry(Entry entry, Element eEntry) throws FeedException {
    if (entry.getTitle() != null) {
        eEntry.addContent(generateSimpleElement("title", entry.getTitle()));
    }
    List links = entry.getAlternateLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }
    links = entry.getOtherLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }

    List cats = entry.getCategories();
    if (cats != null) {
        for (int i = 0; i < cats.size(); i++) {
            eEntry.addContent(generateCategoryElement((Category)cats.get(i)));
        }
    }
    
    List authors = entry.getAuthors();
    if (authors != null && authors.size() > 0) {
        for (int i = 0; i < authors.size(); i++)  {
            Element authorElement = new Element("author", getFeedNamespace());
            fillPersonElement(authorElement, (Person)entry.getAuthors().get(i));
            eEntry.addContent(authorElement);            
        }
    }

    List contributors = entry.getContributors();
    if (contributors != null && contributors.size() > 0) {
        for (int i = 0; i < contributors.size(); i++) {
            Element contributorElement = new Element("contributor", getFeedNamespace());
            fillPersonElement(contributorElement, (Person)contributors.get(i));
            eEntry.addContent(contributorElement);
        }
    }
    if (entry.getId() != null) {
        eEntry.addContent(generateSimpleElement("id", entry.getId()));
    }

    if (entry.getUpdated() != null) {
        Element updatedElement = new Element("updated", getFeedNamespace());
        updatedElement.addContent(DateParser.formatW3CDateTime(entry.getUpdated()));
        eEntry.addContent(updatedElement);
    }

    if (entry.getPublished() != null) {
        Element publishedElement = new Element("published", getFeedNamespace());
        publishedElement.addContent(DateParser.formatW3CDateTime(entry.getPublished()));
        eEntry.addContent(publishedElement);
    }

    if (entry.getContents() != null && entry.getContents().size() > 0) {
        Element contentElement = new Element("content", getFeedNamespace());
        Content content = (Content)entry.getContents().get(0);
        fillContentElement(contentElement, content);
        eEntry.addContent(contentElement);
    }

    if (entry.getSummary() != null) {
        Element summaryElement = new Element("summary", getFeedNamespace());
        fillContentElement(summaryElement, entry.getSummary());
        eEntry.addContent(summaryElement);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:71,代码来源:Atom10Generator.java

示例2: populateEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
protected void populateEntry(Entry entry, Element eEntry) throws FeedException {
    if (entry.getTitleEx() != null) {
        Element titleElement = new Element("title", getFeedNamespace());
        fillContentElement(titleElement, entry.getTitleEx());
        eEntry.addContent(titleElement);
    }
    List links = entry.getAlternateLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }
    links = entry.getOtherLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }

    List cats = entry.getCategories();
    if (cats != null) {
        for (int i = 0; i < cats.size(); i++) {
            eEntry.addContent(generateCategoryElement((Category)cats.get(i)));
        }
    }
    
    List authors = entry.getAuthors();
    if (authors != null && authors.size() > 0) {
        for (int i = 0; i < authors.size(); i++)  {
            Element authorElement = new Element("author", getFeedNamespace());
            fillPersonElement(authorElement, (Person)entry.getAuthors().get(i));
            eEntry.addContent(authorElement);            
        }
    }

    List contributors = entry.getContributors();
    if (contributors != null && contributors.size() > 0) {
        for (int i = 0; i < contributors.size(); i++) {
            Element contributorElement = new Element("contributor", getFeedNamespace());
            fillPersonElement(contributorElement, (Person)contributors.get(i));
            eEntry.addContent(contributorElement);
        }
    }
    if (entry.getId() != null) {
        eEntry.addContent(generateSimpleElement("id", entry.getId()));
    }

    if (entry.getUpdated() != null) {
        Element updatedElement = new Element("updated", getFeedNamespace());
        updatedElement.addContent(DateParser.formatW3CDateTime(entry.getUpdated()));
        eEntry.addContent(updatedElement);
    }

    if (entry.getPublished() != null) {
        Element publishedElement = new Element("published", getFeedNamespace());
        publishedElement.addContent(DateParser.formatW3CDateTime(entry.getPublished()));
        eEntry.addContent(publishedElement);
    }

    if (entry.getContents() != null && entry.getContents().size() > 0) {
        Element contentElement = new Element("content", getFeedNamespace());
        Content content = (Content)entry.getContents().get(0);
        fillContentElement(contentElement, content);
        eEntry.addContent(contentElement);
    }

    if (entry.getSummary() != null) {
        Element summaryElement = new Element("summary", getFeedNamespace());
        fillContentElement(summaryElement, entry.getSummary());
        eEntry.addContent(summaryElement);
    }

    if (entry.getSource() != null) {
    	Element sourceElement = new Element("source", getFeedNamespace());
        populateFeedHeader(entry.getSource(), sourceElement);
        eEntry.addContent(sourceElement);
    }
}
 
开发者ID:4thline,项目名称:feeds,代码行数:79,代码来源:Atom10Generator.java

示例3: populateEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
protected void populateEntry(Entry entry, Element eEntry) throws FeedException {
    if (entry.getTitle() != null) {
        eEntry.addContent(generateSimpleElement("title", entry.getTitle()));
    }
    List links = entry.getAlternateLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }
    links = entry.getOtherLinks();
    if (links != null) {
        for (int i = 0; i < links.size(); i++) {
            eEntry.addContent(generateLinkElement((Link)links.get(i)));
        }
    }

    List cats = entry.getCategories();
    if (cats != null) {
        for (int i = 0; i < cats.size(); i++) {
            eEntry.addContent(generateCategoryElement((Category)cats.get(i)));
        }
    }
    
    List authors = entry.getAuthors();
    if (authors != null && authors.size() > 0) {
        for (int i = 0; i < authors.size(); i++)  {
            Element authorElement = new Element("author", getFeedNamespace());
            fillPersonElement(authorElement, (Person)entry.getAuthors().get(i));
            eEntry.addContent(authorElement);            
        }
    }

    List contributors = entry.getContributors();
    if (contributors != null && contributors.size() > 0) {
        for (int i = 0; i < contributors.size(); i++) {
            Element contributorElement = new Element("contributor", getFeedNamespace());
            fillPersonElement(contributorElement, (Person)contributors.get(i));
            eEntry.addContent(contributorElement);
        }
    }
    if (entry.getId() != null) {
        eEntry.addContent(generateSimpleElement("id", entry.getId()));
    }

    if (entry.getUpdated() != null) {
        Element updatedElement = new Element("updated", getFeedNamespace());
        updatedElement.addContent(DateParser.formatW3CDateTime(entry.getUpdated()));
        eEntry.addContent(updatedElement);
    }

    if (entry.getPublished() != null) {
        Element publishedElement = new Element("published", getFeedNamespace());
        publishedElement.addContent(DateParser.formatW3CDateTime(entry.getPublished()));
        eEntry.addContent(publishedElement);
    }

    if (entry.getContents() != null && entry.getContents().size() > 0) {
        Element contentElement = new Element("content", getFeedNamespace());
        Content content = (Content)entry.getContents().get(0);
        fillContentElement(contentElement, content);
        eEntry.addContent(contentElement);
    }

    if (entry.getSummary() != null) {
        Element summaryElement = new Element("summary", getFeedNamespace());
        fillContentElement(summaryElement, entry.getSummary());
        eEntry.addContent(summaryElement);
    }

    generateForeignMarkup(eEntry, (List)entry.getForeignMarkup());
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:73,代码来源:Atom10Generator.java


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