本文整理汇总了Java中com.sun.syndication.feed.rss.Content.setType方法的典型用法代码示例。如果您正苦于以下问题:Java Content.setType方法的具体用法?Java Content.setType怎么用?Java Content.setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.rss.Content
的用法示例。
在下文中一共展示了Content.setType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}