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


Java SyndFeed.setPublishedDate方法代码示例

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndFeed.setPublishedDate方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.setPublishedDate方法的具体用法?Java SyndFeed.setPublishedDate怎么用?Java SyndFeed.setPublishedDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.syndication.feed.synd.SyndFeed的用法示例。


在下文中一共展示了SyndFeed.setPublishedDate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Channel channel = (Channel) feed;
    super.copyInto(channel,syndFeed);
    syndFeed.setLanguage(channel.getLanguage());        //c
    syndFeed.setCopyright(channel.getCopyright());      //c
    Date pubDate = channel.getPubDate();
    if (pubDate!=null) {
        syndFeed.setPublishedDate(pubDate);     //c
    }

    String author = channel.getManagingEditor();
    if (author!=null) {    
        List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();
        if (!creators.contains(author)) {
            Set s = new HashSet(); // using a set to remove duplicates
            s.addAll(creators);    // DC creators
            s.add(author);         // feed native author
            creators.clear();
            creators.addAll(s);
        }
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:ConverterForRSS091Userland.java

示例2: generateFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries )
{
    if( dataEntries.size() ==  0 )
    {
        log.debug( "No updates found, feed not generated." );
        return null;
    }
    
    SyndFeed feed = new SyndFeedImpl();
    feed.setTitle( title );        
    feed.setDescription( description );
    feed.setLanguage( DEFAULT_LANGUAGE );
    feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() );
    feed.setFeedType( DEFAULT_FEEDTYPE );
    feed.setEntries( getEntries( dataEntries ) );

    log.debug( "Finished generating the feed \'{}\'.", title );
    
    return feed;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:21,代码来源:RssFeedGenerator.java

示例3: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Channel channel = (Channel) feed;
    super.copyInto(channel,syndFeed);
    syndFeed.setLanguage(channel.getLanguage());        //c
    syndFeed.setCopyright(channel.getCopyright());      //c
    Date pubDate = channel.getPubDate();
    if (pubDate!=null) {
        syndFeed.setPublishedDate(pubDate);  //c
    } else if (channel.getLastBuildDate() != null) {
        syndFeed.setPublishedDate(channel.getLastBuildDate());  //c
    }
    

    String author = channel.getManagingEditor();
    if (author!=null) {    
        List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();
        if (!creators.contains(author)) {
            Set s = new HashSet(); // using a set to remove duplicates
            s.addAll(creators);    // DC creators
            s.add(author);         // feed native author
            creators.clear();
            creators.addAll(s);
        }
    }

}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:27,代码来源:ConverterForRSS091Userland.java

示例4: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public void copyInto(WireFeed feed, SyndFeed syndFeed) {
    Channel channel = (Channel) feed;
    super.copyInto(channel, syndFeed);
    syndFeed.setLanguage(channel.getLanguage()); //c
    syndFeed.setCopyright(channel.getCopyright()); //c

    Date pubDate = channel.getPubDate();

    if (pubDate != null) {
        syndFeed.setPublishedDate(pubDate); //c
    } else if (channel.getLastBuildDate() != null) {
        syndFeed.setPublishedDate(channel.getLastBuildDate()); //c
    }

    String author = channel.getManagingEditor();

    if (author != null) {
        List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();

        if (!creators.contains(author)) {
            Set s = new HashSet(); // using a set to remove duplicates
            s.addAll(creators); // DC creators
            s.add(author); // feed native author
            creators.clear();
            creators.addAll(s);
        }
    }
}
 
开发者ID:4thline,项目名称:feeds,代码行数:30,代码来源:ConverterForRSS091Userland.java

示例5: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed, SyndFeed syndFeed) {
    Feed aFeed = (Feed) feed;

    syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));

    syndFeed.setEncoding(aFeed.getEncoding());

    syndFeed.setUri(aFeed.getId());

    syndFeed.setTitle(aFeed.getTitle());

    Content aSubtitle = aFeed.getSubtitle();
    if (aSubtitle!=null) {
        syndFeed.setDescription(aSubtitle.getValue());
    }

    // if there is exactly one alternate link, use that as THE link
    if (aFeed.getAlternateLinks() != null 
            && aFeed.getAlternateLinks().size() == 1) {
        Link theLink = (Link)aFeed.getAlternateLinks().get(0);
        syndFeed.setLink(theLink.getHref());
    }
    // lump alternate and other links together
    List syndLinks = new ArrayList();
    if (aFeed.getAlternateLinks() != null 
            && aFeed.getAlternateLinks().size() > 0) {
        syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks()));
    }
    if (aFeed.getOtherLinks() != null 
            && aFeed.getOtherLinks().size() > 0) {
        syndLinks.addAll(createSyndLinks(aFeed.getOtherLinks()));
    }
        
    List aEntries = aFeed.getEntries();
    if (aEntries!=null) {
        syndFeed.setEntries(createSyndEntries(aFeed, aEntries));
    }

    // Core Atom language/author/copyright/modified elements have precedence
    // over DC equivalent info.

    List authors = aFeed.getAuthors();
    if (authors!=null && authors.size() > 0) {
        syndFeed.setAuthors(ConverterForAtom03.createSyndPersons(authors));
    }

    String rights = aFeed.getRights();
    if (rights!=null) {
        syndFeed.setCopyright(rights);
    }

    Date date = aFeed.getUpdated();
    if (date!=null) {
        syndFeed.setPublishedDate(date);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:57,代码来源:ConverterForAtom10.java

示例6: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Feed aFeed = (Feed) feed;

    syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));

    syndFeed.setEncoding(aFeed.getEncoding());

    syndFeed.setUri(aFeed.getId());

    syndFeed.setTitle(aFeed.getTitle());

    String linkHref = null;
    if (aFeed.getAlternateLinks().size() > 0) {
        linkHref = ((Link) aFeed.getAlternateLinks().get(0)).getHref();
    }
    syndFeed.setLink(linkHref);

    Content tagline = aFeed.getTagline();
    if (tagline!=null) {
        syndFeed.setDescription(tagline.getValue());
    }


    List aEntries = aFeed.getEntries();
    if (aEntries!=null) {
        syndFeed.setEntries(createSyndEntries(aEntries));
    }

    // Core Atom language/author/copyright/modified elements have precedence
    // over DC equivalent info.

    String language = aFeed.getLanguage();
    if (language!=null) {
        syndFeed.setLanguage(language);
    }

    List authors = aFeed.getAuthors();
    if (authors!=null && authors.size() > 0) {
        syndFeed.setAuthors(createSyndPersons(authors));
    }

    String copyright = aFeed.getCopyright();
    if (copyright!=null) {
        syndFeed.setCopyright(copyright);
    }

    Date date = aFeed.getModified();
    if (date!=null) {
        syndFeed.setPublishedDate(date);
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:53,代码来源:ConverterForAtom03.java

示例7: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Feed aFeed = (Feed) feed;

    syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));

    if (((List)feed.getForeignMarkup()).size() > 0) {
        syndFeed.setForeignMarkup(feed.getForeignMarkup());
    }
    
    syndFeed.setEncoding(aFeed.getEncoding());

    syndFeed.setUri(aFeed.getId());

    syndFeed.setTitle(aFeed.getTitle());

    // use first alternate links as THE link
    if (aFeed.getAlternateLinks() != null
            && aFeed.getAlternateLinks().size() > 0) {
        Link theLink = (Link)aFeed.getAlternateLinks().get(0);
        syndFeed.setLink(theLink.getHrefResolved());
    }
    // lump alternate and other links together
    List syndLinks = new ArrayList();
    if (aFeed.getAlternateLinks() != null
            && aFeed.getAlternateLinks().size() > 0) {
        syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks()));
    }
    if (aFeed.getOtherLinks() != null
            && aFeed.getOtherLinks().size() > 0) {
        syndLinks.addAll(createSyndLinks(aFeed.getOtherLinks()));
    }
    syndFeed.setLinks(syndLinks);

    Content tagline = aFeed.getTagline();
    if (tagline!=null) {
        syndFeed.setDescription(tagline.getValue());
    }


    List aEntries = aFeed.getEntries();
    if (aEntries!=null) {
        syndFeed.setEntries(createSyndEntries(aEntries, syndFeed.isPreservingWireFeed()));
    }

    // Core Atom language/author/copyright/modified elements have precedence
    // over DC equivalent info.

    String language = aFeed.getLanguage();
    if (language!=null) {
        syndFeed.setLanguage(language);
    }

    List authors = aFeed.getAuthors();
    if (authors!=null && authors.size() > 0) {
        syndFeed.setAuthors(createSyndPersons(authors));
    }

    String copyright = aFeed.getCopyright();
    if (copyright!=null) {
        syndFeed.setCopyright(copyright);
    }

    Date date = aFeed.getModified();
    if (date!=null) {
        syndFeed.setPublishedDate(date);
    }

}
 
开发者ID:4thline,项目名称:feeds,代码行数:69,代码来源:ConverterForAtom03.java

示例8: copyInto

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Feed aFeed = (Feed) feed;

    syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));

    if (((List)feed.getForeignMarkup()).size() > 0) {
        syndFeed.setForeignMarkup(feed.getForeignMarkup());
    }
    
    syndFeed.setEncoding(aFeed.getEncoding());

    syndFeed.setUri(aFeed.getId());

    syndFeed.setTitle(aFeed.getTitle());

    String linkHref = null;
    if (aFeed.getAlternateLinks().size() > 0) {
        linkHref = ((Link) aFeed.getAlternateLinks().get(0)).getHref();
    }
    syndFeed.setLink(linkHref);

    Content tagline = aFeed.getTagline();
    if (tagline!=null) {
        syndFeed.setDescription(tagline.getValue());
    }


    List aEntries = aFeed.getEntries();
    if (aEntries!=null) {
        syndFeed.setEntries(createSyndEntries(aEntries));
    }

    // Core Atom language/author/copyright/modified elements have precedence
    // over DC equivalent info.

    String language = aFeed.getLanguage();
    if (language!=null) {
        syndFeed.setLanguage(language);
    }

    List authors = aFeed.getAuthors();
    if (authors!=null && authors.size() > 0) {
        syndFeed.setAuthors(createSyndPersons(authors));
    }

    String copyright = aFeed.getCopyright();
    if (copyright!=null) {
        syndFeed.setCopyright(copyright);
    }

    Date date = aFeed.getModified();
    if (date!=null) {
        syndFeed.setPublishedDate(date);
    }

}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:57,代码来源:ConverterForAtom03.java


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