本文整理汇总了Java中com.sun.syndication.feed.atom.Entry.setSummary方法的典型用法代码示例。如果您正苦于以下问题:Java Entry.setSummary方法的具体用法?Java Entry.setSummary怎么用?Java Entry.setSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.atom.Entry
的用法示例。
在下文中一共展示了Entry.setSummary方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: buildFeedEntries
import com.sun.syndication.feed.atom.Entry; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map model, HttpServletRequest request, HttpServletResponse response)
throws Exception {
List<Entry> entries = new ArrayList<Entry>();
for (Iterator iterator = model.keySet().iterator(); iterator.hasNext();) {
String name = (String) iterator.next();
Entry entry = new Entry();
entry.setTitle(name);
Content content = new Content();
content.setValue((String) model.get(name));
entry.setSummary(content);
entries.add(entry);
}
return entries;
}
示例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;
}
示例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;
}