当前位置: 首页>>代码示例>>Java>>正文


Java Content类代码示例

本文整理汇总了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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:24,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:23,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:27,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:32,代码来源:RSS10Parser.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:26,代码来源:RSS091UserlandParser.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:23,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:21,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:18,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:7,代码来源:ConverterForRSS10.java


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