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