本文整理汇总了Java中com.sun.syndication.feed.rss.Content类的典型用法代码示例。如果您正苦于以下问题:Java Content类的具体用法?Java Content怎么用?Java Content使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Content类属于com.sun.syndication.feed.rss包,在下文中一共展示了Content类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSyndEntry
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
@Override
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
Description desc = item.getDescription();
if (desc!=null) {
SyndContent descContent = new SyndContentImpl();
descContent.setType(desc.getType());
descContent.setValue(desc.getValue());
syndEntry.setDescription(descContent);
}
Content cont = item.getContent();
if (cont!=null) {
SyndContent contContent = new SyndContentImpl();
contContent.setType(cont.getType());
contContent.setValue(cont.getValue());
List contents = new ArrayList();
contents.add(contContent);
syndEntry.setContents(contents);
}
return syndEntry;
}
示例2: createRSSItem
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
@Override
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent sContent = sEntry.getDescription();
if (sContent != null) {
item.setDescription(createItemDescription(sContent));
}
List contents = sEntry.getContents();
if ((contents != null) && (contents.size() > 0)) {
SyndContent syndContent = (SyndContent) contents.get(0);
Content cont = new Content();
cont.setValue(syndContent.getValue());
cont.setType(syndContent.getType());
item.setContent(cont);
}
return item;
}
示例3: createSyndEntry
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
@Override
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
Description desc = item.getDescription();
if (desc != null) {
SyndContent descContent = new SyndContentImpl();
descContent.setType(desc.getType());
descContent.setValue(desc.getValue());
syndEntry.setDescription(descContent);
}
Content cont = item.getContent();
if (cont != null) {
SyndContent content = new SyndContentImpl();
content.setType(cont.getType());
content.setValue(cont.getValue());
List syndContents = new ArrayList();
syndContents.add(content);
syndEntry.setContents(syndContents);
}
return syndEntry;
}
示例4: parseItem
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
/**
* Parses an item element of an RSS document looking for item information.
* <p/>
* It first invokes super.parseItem and then parses and injects the description property if present.
* <p/>
*
* @param rssRoot the root element of the RSS document in case it's needed for context.
* @param eItem the item element to parse.
* @return the parsed RSSItem bean.
*/
protected Item parseItem(Element rssRoot,Element eItem) {
Item item = super.parseItem(rssRoot,eItem);
Element e = eItem.getChild("description", getRSSNamespace());
if (e!=null) {
item.setDescription(parseItemDescription(rssRoot,e));
}
Element ce = eItem.getChild("encoded", getContentNamespace());
if (ce != null) {
Content content = new Content();
content.setType(Content.HTML);
content.setValue(ce.getText());
item.setContent(content);
}
String uri = eItem.getAttributeValue("about", getRDFNamespace());
if (uri != null) {
item.setUri(uri);
}
return item;
}
示例5: parseItem
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
/**
* Parses an item element of an RSS document looking for item information.
* <p/>
* It first invokes super.parseItem and then parses and injects the description property if present.
* <p/>
*
* @param rssRoot the root element of the RSS document in case it's needed for context.
* @param eItem the item element to parse.
* @return the parsed RSSItem bean.
*/
protected Item parseItem(Element rssRoot, Element eItem) {
Item item = super.parseItem(rssRoot,eItem);
Element e = eItem.getChild("description", getRSSNamespace());
if (e!=null) {
item.setDescription(parseItemDescription(rssRoot,e));
}
Element ce = eItem.getChild("encoded", getContentNamespace());
if (ce != null) {
Content content = new Content();
content.setType(Content.HTML);
content.setValue(ce.getText());
item.setContent(content);
}
return item;
}
示例6: createSyndEntry
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
Description desc = item.getDescription();
if (desc!=null) {
SyndContent descContent = new SyndContentImpl();
descContent.setType(desc.getType());
descContent.setValue(desc.getValue());
syndEntry.setDescription(descContent);
}
Content cont = item.getContent();
if (cont!=null) {
SyndContent contContent = new SyndContentImpl();
contContent.setType(cont.getType());
contContent.setValue(cont.getValue());
List contents = new ArrayList();
contents.add(contContent);
syndEntry.setContents(contents);
}
return syndEntry;
}
示例7: createSyndEntry
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
Description desc = item.getDescription();
if (desc != null) {
SyndContent descContent = new SyndContentImpl();
descContent.setType(desc.getType());
descContent.setValue(desc.getValue());
syndEntry.setDescription(descContent);
}
Content cont = item.getContent();
if (cont != null) {
SyndContent content = new SyndContentImpl();
content.setType(cont.getType());
content.setValue(cont.getValue());
List syndContents = new ArrayList();
syndContents.add(content);
syndEntry.setContents(syndContents);
}
return syndEntry;
}
示例8: createRSSItem
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent sContent = sEntry.getDescription();
if (sContent!=null) {
item.setDescription(createItemDescription(sContent));
}
List contents = sEntry.getContents();
if (contents != null && contents.size() > 0) {
SyndContent syndContent = (SyndContent)contents.get(0);
Content cont = new Content();
cont.setValue(syndContent.getValue());
cont.setType(syndContent.getType());
item.setContent(cont);
}
return item;
}
示例9: createItemContent
import com.sun.syndication.feed.rss.Content; //导入依赖的package包/类
protected Content createItemContent(SyndContent sContent) {
Content cont = new Content();
cont.setValue(sContent.getValue());
cont.setType(sContent.getType());
return cont;
}