本文整理汇总了Java中com.sun.syndication.feed.synd.SyndContentImpl.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java SyndContentImpl.setValue方法的具体用法?Java SyndContentImpl.setValue怎么用?Java SyndContentImpl.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.synd.SyndContentImpl
的用法示例。
在下文中一共展示了SyndContentImpl.setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTitleEx
import com.sun.syndication.feed.synd.SyndContentImpl; //导入方法依赖的package包/类
@Override
public SyndContent getTitleEx() {
SyndContent c = super.getTitleEx();
SyndContentImpl result = new SyndContentImpl();
if (c != null) {
result.setMode(removeInvalidChars(c.getMode()));
result.setType(removeInvalidChars(c.getType()));
result.setValue(removeInvalidChars(c.getValue()));
}
return result;
}
示例2: createInvalidLinkedEntriesWithTestDescription
import com.sun.syndication.feed.synd.SyndContentImpl; //导入方法依赖的package包/类
private List<SyndEntry> createInvalidLinkedEntriesWithTestDescription() {
SyndEntry entry1 = new SyndEntryImpl();
entry1.setLink("test://not_exists1.html");
SyndContentImpl syndContent1 = new SyndContentImpl();
syndContent1.setValue("Test");
entry1.setDescription(syndContent1);
SyndEntry entry2 = new SyndEntryImpl();
entry2.setLink("test://not_exists2.html");
SyndContentImpl syndContent2 = new SyndContentImpl();
syndContent2.setValue("Test");
entry2.setDescription(syndContent2);
return Arrays.asList(entry1, entry2);
}
示例3: createValidLinkedEntriesWithEmptyDescription
import com.sun.syndication.feed.synd.SyndContentImpl; //导入方法依赖的package包/类
private List<SyndEntry> createValidLinkedEntriesWithEmptyDescription(String content) {
SyndEntry entry1 = new SyndEntryImpl();
entry1.setLink("test://feeds/valid_feed/content_1.html");
SyndContentImpl syndContent1 = new SyndContentImpl();
syndContent1.setValue(content);
entry1.setDescription(syndContent1);
SyndEntry entry2 = new SyndEntryImpl();
entry2.setLink("test://feeds/valid_feed/content_2.html");
SyndContentImpl syndContent2 = new SyndContentImpl();
syndContent2.setValue(content);
entry2.setDescription(syndContent2);
return Arrays.asList(entry1, entry2);
}
示例4: applyFeedEntry
import com.sun.syndication.feed.synd.SyndContentImpl; //导入方法依赖的package包/类
private void applyFeedEntry(List<SyndEntry> result, String author, String content) {
SyndEntryImpl entry = new SyndEntryImpl();
entry.setAuthor(author);
SyndContentImpl desc = new SyndContentImpl();
desc.setValue(content);
entry.setDescription(desc);
entry.setContents(Arrays.asList(desc));
result.add(entry);
}
示例5: rss
import com.sun.syndication.feed.synd.SyndContentImpl; //导入方法依赖的package包/类
public String rss() throws IOException, FeedException {
SyndFeed feed = new SyndFeedImpl();
feed.setTitle("hiscores.shmup.com");
feed.setFeedType("rss_2.0");
feed.setDescription("hiscores.shmup.com");
feed.setLink("http://hiscores.shmup.com");
List entries = new ArrayList();
feed.setEntries(entries);
for (Score score : scores) {
SyndEntry entry = new SyndEntryImpl();
entry.setTitle(score.getGameTitle());
entry.setAuthor(score.player.name);
entry.setLink("http://hiscores.shmup.com/score/" + score.id);
SyndContentImpl content = new SyndContentImpl();
content.setValue(score.tweet());
entry.setDescription(content);
entry.setPublishedDate(score.getCreatedAt());
entry.setUpdatedDate(score.getCreatedAt());
SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
enclosure.setUrl(score.game.cover);
enclosure.setType(score.game.getCoverType());
entry.setEnclosures(Lists.newArrayList(enclosure));
entries.add(entry);
}
Writer writer = new StringWriter();
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, writer);
writer.close();
Controller.response().setContentType("application/rss+xml");
return writer.toString();
}