• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Description类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.rometools.rome.feed.rss.Description的典型用法代码示例。如果您正苦于以下问题:Java Description类的具体用法?Java Description怎么用?Java Description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Description类属于com.rometools.rome.feed.rss包,在下文中一共展示了Description类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildFeedItems

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    	
        List<Podcast> podcasts = (List<Podcast>) model.get("list_of_podcasts");
        List<Item> items = new ArrayList<Item>(podcasts.size());

        for (Podcast podcast : podcasts) {
            Item item = new Item();
//            String date = String.format("%1$tY-%1$tm-%1$td", podcast.getLastEpisode().getPublicationDate());
            item.setTitle(podcast.getTitle());
            item.setPubDate(podcast.getPublicationDate());
            item.setLink(model.get("HOST_AND_PORT_URL") + "/podcasts/" + podcast.getPodcastId() 
            		+ "/" + podcast.getTitleInUrl());
            
            Description podcastDescription = new Description();
            podcastDescription.setValue(podcast.getDescription());
            item.setDescription(podcastDescription);  
                        
            items.add(item);
        }

        return items;
    }
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:24,代码来源:FoundPodcastsRssFeedView.java


示例2: populateItem

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected void populateItem(final Item item, final Element eItem, final int index) {

    super.populateItem(item, eItem, index);

    final String link = item.getLink();
    final String uri = item.getUri();
    if (uri != null) {
        eItem.setAttribute("about", uri, getRDFNamespace());
    } else if (link != null) {
        eItem.setAttribute("about", link, getRDFNamespace());
    }

    final Description description = item.getDescription();
    if (description != null) {
        eItem.addContent(generateSimpleElement("description", description.getValue()));
    }

    if (item.getModule(getContentNamespace().getURI()) == null && item.getContent() != null) {
        final Element elem = new Element("encoded", getContentNamespace());
        elem.addContent(item.getContent().getValue());
        eItem.addContent(elem);
    }

}
 
开发者ID:rometools,项目名称:rome,代码行数:26,代码来源:RSS10Generator.java


示例3: populateItem

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected void populateItem(final Item item, final Element eItem, final int index) {

    super.populateItem(item, eItem, index);

    final Description description = item.getDescription();
    if (description != null) {
        eItem.addContent(generateSimpleElement("description", description.getValue()));
    }

    final Namespace contentNamespace = getContentNamespace();
    final Content content = item.getContent();
    if (item.getModule(contentNamespace.getURI()) == null && content != null) {
        final Element elem = new Element("encoded", contentNamespace);
        elem.addContent(content.getValue());
        eItem.addContent(elem);
    }

}
 
开发者ID:rometools,项目名称:rome,代码行数:20,代码来源:RSS091UserlandGenerator.java


示例4: createDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
private Description createDescription(Post post) {

        Long postId = post.getPostId();
        if (post.isMultiPhotoPost())
            post.setPostImages(postService.getPostImages(postId));
        if (post.isSinglePhotoPost())
            post.setSingleImage(postService.getPostImages(postId).get(0));

        Description description = new Description();
        description.setType(Content.HTML);
        description.setValue(fmService.createRssPostContent(post));
        return description;
    }
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:14,代码来源:RssPostFeedView.java


示例5: buildFeedItems

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected List<Item> buildFeedItems(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
	List<Item> items = new ArrayList<Item>();
	for (String name : model.keySet()) {
		Item item = new Item();
		item.setTitle(name);
		Description description = new Description();
		description.setValue((String) model.get(name));
		item.setDescription(description);
		items.add(item);
	}
	return items;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:RssFeedViewTests.java


示例6: convertArticle

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
private Item convertArticle(Article article) {
  Item entry = new Item();
  Guid guid = new Guid();
  guid.setValue(article.getArticleId().toString());
  entry.setGuid(guid);
  entry.setTitle(cleanXml10Characters(article.getTitle()));
  entry.setPubDate(Date.from(article.getCreateTime()));
  Description summary = new Description();
  summary.setType("html");
  summary.setValue(buildSummary(article));
  entry.setDescription(summary);
  entry.setLink(articleUrl(article));
  return entry;
}
 
开发者ID:kaif-open,项目名称:kaif,代码行数:15,代码来源:HotArticleRssContentView.java


示例7: buildFeedItems

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
    throws Exception {
	
    List<Episode> episodes = (List<Episode>) model.get("list_of_episodes");
    List<Item> items = new ArrayList<Item>(episodes.size());

    for (Episode episode : episodes) {
        Item item = new Item();
        String date = String.format("%1$tY-%1$tm-%1$td", episode.getPublicationDate());
        item.setTitle(episode.getTitle());
        item.setPubDate(episode.getPublicationDate());
        item.setLink(model.get("HOST_AND_PORT_URL") + "/podcasts/" + episode.getPodcastId() 
        		+ "/" + episode.getPodcast().getTitleInUrl()+ "/episodes/" + episode.getEpisodeId()
        		+ "/" + episode.getTitleInUrl());
        
        Description episodeDescription = new Description();
        episodeDescription.setValue(episode.getDescription());
        item.setDescription(episodeDescription);  
        
        //set enclosures
        List<Enclosure> enclosures = new ArrayList<Enclosure>();
        Enclosure enclosure = new Enclosure();
        enclosure.setUrl(episode.getMediaUrl());
        if(episode.getLength() != null) enclosure.setLength(episode.getLength());
        if(episode.getEnclosureType() != null ) enclosure.setType(episode.getEnclosureType()); 
        enclosures.add(enclosure);
        item.setEnclosures(enclosures);
        
        items.add(item);
    }

    return items;
}
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:34,代码来源:FoundEpisodesRssFeedView.java


示例8: buildFeedItems

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
    throws Exception {
	
    List<Podcast> podcasts = (List<Podcast>) model.get("list_of_podcasts");
    List<Item> items = new ArrayList<Item>(podcasts.size());

    for (Podcast podcast : podcasts) {
        Episode episode = podcast.getLastEpisode();
        Item item = new Item();
        String date = String.format("%1$tY-%1$tm-%1$td", episode.getPublicationDate());
        item.setTitle(podcast.getTitle()+ " - " + episode.getTitle());
        item.setPubDate(podcast.getPublicationDate());
        item.setLink( model.get("HOST_AND_PORT_URL") + "/podcasts/" + podcast.getPodcastId() 
        		+ "/" + podcast.getTitleInUrl() );
        
        Description episodeDescription = new Description();
        episodeDescription.setValue(episode.getDescription());
        item.setDescription(episodeDescription);  
        
        //set enclosures
        List<Enclosure> enclosures = new ArrayList<Enclosure>();
        Enclosure enclosure = new Enclosure();
        enclosure.setUrl(episode.getMediaUrl());    
        if(episode.getLength() != null) enclosure.setLength(episode.getLength());
        if(episode.getEnclosureType() != null ) enclosure.setType(episode.getEnclosureType());             
        enclosures.add(enclosure);
        item.setEnclosures(enclosures);
        
        items.add(item);
    }

    return items;
}
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:34,代码来源:GenericRssFeedView.java


示例9: createDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
private Description createDescription(String content) {
	Description description = new Description();
	description.setType(Content.HTML);
	description.setValue(content);

	return description;
}
 
开发者ID:JakduK,项目名称:jakduk-api,代码行数:8,代码来源:DocumentRssFeedView.java


示例10: createSyndEntry

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected SyndEntry createSyndEntry(final Item item, final boolean preserveWireItem) {

    final SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);

    final Description desc = item.getDescription();
    if (desc != null) {
        final SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }

    final Content cont = item.getContent();
    if (cont != null) {

        final SyndContent contContent = new SyndContentImpl();
        contContent.setType(cont.getType());
        contContent.setValue(cont.getValue());

        final List<SyndContent> contents = new ArrayList<SyndContent>();
        contents.add(contContent);
        syndEntry.setContents(contents);

    }

    return syndEntry;

}
 
开发者ID:rometools,项目名称:rome,代码行数:30,代码来源:ConverterForRSS10.java


示例11: createSyndEntry

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected SyndEntry createSyndEntry(final Item item, final boolean preserveWireItem) {

    final SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);

    final Description desc = item.getDescription();

    syndEntry.setComments(item.getComments());

    if (desc != null) {
        final SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }

    final Content cont = item.getContent();

    if (cont != null) {
        final SyndContent content = new SyndContentImpl();
        content.setType(cont.getType());
        content.setValue(cont.getValue());

        final List<SyndContent> syndContents = new ArrayList<SyndContent>();
        syndContents.add(content);
        syndEntry.setContents(syndContents);
    }

    return syndEntry;
}
 
开发者ID:rometools,项目名称:rome,代码行数:31,代码来源:ConverterForRSS091Userland.java


示例12: parseItemDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected Description parseItemDescription(final Element rssRoot, final Element eDesc) {
    final Description desc = new Description();
    final StringBuilder sb = new StringBuilder();
    final XMLOutputter xmlOut = new XMLOutputter();
    for (final Content c : eDesc.getContent()) {
        switch (c.getCType()) {
            case Text:
            case CDATA:
                sb.append(c.getValue());
                break;
            case EntityRef:
                LOG.debug("Entity: {}", c.getValue());
                sb.append(c.getValue());
                break;
            case Element:
                sb.append(xmlOut.outputString((Element) c));
                break;
            default:
                // ignore
                break;
        }
    }
    desc.setValue(sb.toString());
    String att = eDesc.getAttributeValue("type");
    if (att == null) {
        att = "text/html";
    }
    desc.setType(att);
    return desc;
}
 
开发者ID:rometools,项目名称:rome,代码行数:32,代码来源:RSS092Parser.java


示例13: populateItem

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected void populateItem(final Item item, final Element eItem, final int index) {
    super.populateItem(item, eItem, index);

    final Description description = item.getDescription();
    if (description != null && description.getType() != null) {
        final Element eDescription = eItem.getChild("description", getFeedNamespace());
        eDescription.setAttribute(new Attribute("type", description.getType()));
    }
    eItem.removeChild("expirationDate", getFeedNamespace());
}
 
开发者ID:rometools,项目名称:rome,代码行数:12,代码来源:RSS094Generator.java


示例14: createSyndEntry

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
	SyndEntry entry = super.createSyndEntry(item, preserveWireItem);
	Description desc = item.getDescription();
	if (desc != null) {
		SyndContentImpl syndDesc = new SyndContentImpl();
		syndDesc.setValue(desc.getValue());
		entry.setDescription(syndDesc);
	}
	return entry;
}
 
开发者ID:Athou,项目名称:commafeed,代码行数:12,代码来源:RSS090DescriptionConverter.java


示例15: parseItem

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected Item parseItem(Element rssRoot, Element eItem, Locale locale) {
	Item item = super.parseItem(rssRoot, eItem, locale);
	Element e = eItem.getChild("description", getRSSNamespace());
	if (e != null) {
		Description desc = new Description();
		desc.setValue(e.getText());
		item.setDescription(desc);
	}

	return item;
}
 
开发者ID:Athou,项目名称:commafeed,代码行数:13,代码来源:RSS090DescriptionParser.java


示例16: createItemDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
protected Description createItemDescription(final SyndContent sContent) {
    final Description desc = new Description();
    desc.setValue(sContent.getValue());
    desc.setType(sContent.getType());
    return desc;
}
 
开发者ID:rometools,项目名称:rome,代码行数:7,代码来源:ConverterForRSS10.java


示例17: parseItemDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
protected Description parseItemDescription(final Element rssRoot, final Element eDesc) {
    final Description desc = new Description();
    desc.setType("text/plain");
    desc.setValue(eDesc.getText());
    return desc;
}
 
开发者ID:rometools,项目名称:rome,代码行数:7,代码来源:RSS10Parser.java


示例18: parseItemDescription

import com.rometools.rome.feed.rss.Description; //导入依赖的package包/类
@Override
protected Description parseItemDescription(final Element rssRoot, final Element eDesc) {
    final Description desc = super.parseItemDescription(rssRoot, eDesc);
    return desc;
}
 
开发者ID:rometools,项目名称:rome,代码行数:6,代码来源:RSS20Parser.java



注:本文中的com.rometools.rome.feed.rss.Description类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataSetBuilder类代码示例发布时间:2022-05-22
下一篇:
Java TimestampSerializer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap