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


Java Entry.setAuthors方法代码示例

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


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

示例1: buildFeedEntries

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(
        Map<String, Object> model,
        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
  
  @SuppressWarnings("unchecked")
  List<Spittle> spittles = (List<Spittle>) model.get("spittles");
  List<Entry> entries = new ArrayList<Entry>();
  for (Spittle spittle : spittles) {
    Entry entry = new Entry();
    entry.setTitle(spittle.getText());
    entry.setCreated(spittle.getWhen());
    entry.setAuthors(asList(spittle.getSpitter().getFullName()));
    entries.add(entry);
  }
  
  return entries;
}
 
开发者ID:liuxianqiang,项目名称:spring-in-action,代码行数:20,代码来源:SpittlesAtomView.java

示例2: parseEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
private Entry parseEntry(Feed feed, Element eEntry, URL baseURI) {
    Entry entry = new Entry();

    String xmlBase = eEntry.getAttributeValue("base", Namespace.XML_NAMESPACE);
    if (xmlBase != null) {
        entry.setXmlBase(xmlBase);
    }
    
    Element e = eEntry.getChild("title",getAtomNamespace());
    if (e!=null) {
        entry.setTitle(e.getText());
    }

    List eList = eEntry.getChildren("link",getAtomNamespace());
    entry.setAlternateLinks(parseAlternateLinks(feed, entry, baseURI, eList));
    entry.setOtherLinks(parseOtherLinks(feed, entry, baseURI, eList));

    eList = eEntry.getChildren("author", getAtomNamespace());
    if (eList.size()>0) {
        entry.setAuthors(parsePersons(baseURI, eList));
    }

    eList = eEntry.getChildren("contributor",getAtomNamespace());
    if (eList.size()>0) {
        entry.setContributors(parsePersons(baseURI, eList));
    }

    e = eEntry.getChild("id",getAtomNamespace());
    if (e!=null) {
        entry.setId(e.getText());
    }

    e = eEntry.getChild("updated",getAtomNamespace());
    if (e!=null) {
        entry.setUpdated(DateParser.parseDate(e.getText()));
    }

    e = eEntry.getChild("published",getAtomNamespace());
    if (e!=null) {
        entry.setPublished(DateParser.parseDate(e.getText()));
    }

    e = eEntry.getChild("summary",getAtomNamespace());
    if (e!=null) {
        entry.setSummary(parseContent(e));
    }

    e = eEntry.getChild("content",getAtomNamespace());
    if (e!=null) {
        List contents = new ArrayList();
        contents.add(parseContent(e));
        entry.setContents(contents);
    }

    e = eEntry.getChild("rights",getAtomNamespace());
    if (e!=null) {
        entry.setRights(e.getText());
    }

    List cList = eEntry.getChildren("category",getAtomNamespace());
    entry.setCategories(parseCategories(baseURI, cList));

    // TODO: SHOULD handle Atom entry source element
    
    entry.setModules(parseItemModules(eEntry));

    return entry;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:69,代码来源:Atom10Parser.java

示例3: parseEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
protected Entry parseEntry(Feed feed, Element eEntry, String baseURI) {
    Entry entry = new Entry();
    
    String xmlBase = eEntry.getAttributeValue("base", Namespace.XML_NAMESPACE);
    if (xmlBase != null) {
        entry.setXmlBase(xmlBase);
    }
    
    Element e = eEntry.getChild("title",getAtomNamespace());
    if (e!=null) {
        Content c = new Content();
        c.setValue(parseTextConstructToString(e));
        c.setType(getAttributeValue(e, "type"));
        entry.setTitleEx(c);
    }
    
    List eList = eEntry.getChildren("link",getAtomNamespace());
    entry.setAlternateLinks(parseAlternateLinks(feed, entry, baseURI, eList));
    entry.setOtherLinks(parseOtherLinks(feed, entry, baseURI, eList));
    
    eList = eEntry.getChildren("author", getAtomNamespace());
    if (eList.size()>0) {
        entry.setAuthors(parsePersons(baseURI, eList));
    }
    
    eList = eEntry.getChildren("contributor",getAtomNamespace());
    if (eList.size()>0) {
        entry.setContributors(parsePersons(baseURI, eList));
    }
    
    e = eEntry.getChild("id",getAtomNamespace());
    if (e!=null) {
        entry.setId(e.getText());
    }
    
    e = eEntry.getChild("updated",getAtomNamespace());
    if (e!=null) {
        entry.setUpdated(DateParser.parseDate(e.getText()));
    }
    
    e = eEntry.getChild("published",getAtomNamespace());
    if (e!=null) {
        entry.setPublished(DateParser.parseDate(e.getText()));
    }
    
    e = eEntry.getChild("summary",getAtomNamespace());
    if (e!=null) {
        entry.setSummary(parseContent(e));
    }
    
    e = eEntry.getChild("content",getAtomNamespace());
    if (e!=null) {
        List contents = new ArrayList();
        contents.add(parseContent(e));
        entry.setContents(contents);
    }
    
    e = eEntry.getChild("rights",getAtomNamespace());
    if (e!=null) {
        entry.setRights(e.getText());
    }
    
    List cList = eEntry.getChildren("category",getAtomNamespace());
    entry.setCategories(parseCategories(baseURI, cList));
    
    // TODO: SHOULD handle Atom entry source element
    e = eEntry.getChild("source", getAtomNamespace());
    if (e!=null) {
        entry.setSource(parseFeedMetadata(baseURI, e));
    }
    
    entry.setModules(parseItemModules(eEntry));
    
    List foreignMarkup =
            extractForeignMarkup(eEntry, entry, getAtomNamespace());
    if (foreignMarkup.size() > 0) {
        entry.setForeignMarkup(foreignMarkup);
    }
    return entry;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:81,代码来源:Atom10Parser.java

示例4: parseEntry

import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
protected Entry parseEntry(Feed feed, Element eEntry, String baseURI) {
    Entry entry = new Entry();
    
    String xmlBase = eEntry.getAttributeValue("base", Namespace.XML_NAMESPACE);
    if (xmlBase != null) {
        entry.setXmlBase(xmlBase);
    }
    
    Element e = eEntry.getChild("title",getAtomNamespace());
    if (e!=null) {
        Content c = new Content();
        c.setValue(parseTextConstructToString(e));
        c.setType(e.getAttributeValue("type")); //, Namespace.XML_NAMESPACE));
        entry.setTitleEx(c);
    }
    
    List eList = eEntry.getChildren("link",getAtomNamespace());
    entry.setAlternateLinks(parseAlternateLinks(feed, entry, baseURI, eList));
    entry.setOtherLinks(parseOtherLinks(feed, entry, baseURI, eList));
    
    eList = eEntry.getChildren("author", getAtomNamespace());
    if (eList.size()>0) {
        entry.setAuthors(parsePersons(baseURI, eList));
    }
    
    eList = eEntry.getChildren("contributor",getAtomNamespace());
    if (eList.size()>0) {
        entry.setContributors(parsePersons(baseURI, eList));
    }
    
    e = eEntry.getChild("id",getAtomNamespace());
    if (e!=null) {
        entry.setId(e.getText());
    }
    
    e = eEntry.getChild("updated",getAtomNamespace());
    if (e!=null) {
        entry.setUpdated(DateParser.parseW3CDateTime(e.getText()));
    }
    
    e = eEntry.getChild("published",getAtomNamespace());
    if (e!=null) {
        entry.setPublished(DateParser.parseW3CDateTime(e.getText()));
    }
    
    e = eEntry.getChild("summary",getAtomNamespace());
    if (e!=null) {
        entry.setSummary(parseContent(e));
    }
    
    e = eEntry.getChild("content",getAtomNamespace());
    if (e!=null) {
        List contents = new ArrayList();
        contents.add(parseContent(e));
        entry.setContents(contents);
    }
    
    e = eEntry.getChild("rights",getAtomNamespace());
    if (e!=null) {
        entry.setRights(e.getText());
    }
    
    List cList = eEntry.getChildren("category",getAtomNamespace());
    entry.setCategories(parseCategories(baseURI, cList));
    
    // TODO: SHOULD handle Atom entry source element
    
    entry.setModules(parseItemModules(eEntry));
    
    List foreignMarkup =
            extractForeignMarkup(eEntry, entry, getAtomNamespace());
    if (foreignMarkup.size() > 0) {
        entry.setForeignMarkup(foreignMarkup);
    }
    return entry;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:77,代码来源:Atom10Parser.java


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