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

Java WireFeed类代码示例

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

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



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

示例1: parseChannel

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed parseChannel(Element rssRoot)  {
    Channel channel = (Channel) super.parseChannel(rssRoot);
    Element eChannel = rssRoot.getChild("channel",getRSSNamespace());

    List eCats = eChannel.getChildren("category",getRSSNamespace());
    channel.setCategories(parseCategories(eCats));

    Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
    if (eTtl!=null) {
        Integer ttlValue = new Integer(eTtl.getText());
        if (ttlValue != null) {
            channel.setTtl(ttlValue.intValue());
        }
    }

    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:RSS094Parser.java


示例2: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));

    syndFeed.setEncoding(feed.getEncoding());
    Channel channel = (Channel) feed;
    syndFeed.setTitle(channel.getTitle());
    syndFeed.setLink(channel.getLink());
    syndFeed.setDescription(channel.getDescription());

    Image image = channel.getImage();
    if (image!=null) {
        syndFeed.setImage(createSyndImage(image));
    }

    List items = channel.getItems();
    if (items!=null) {
        syndFeed.setEntries(createSyndEntries(items));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:ConverterForRSS090.java


示例3: createRealFeed

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = new Channel(type);
    channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));

    channel.setEncoding(syndFeed.getEncoding());

    channel.setTitle(syndFeed.getTitle());
    channel.setLink(syndFeed.getLink());
    channel.setDescription(syndFeed.getDescription());
    SyndImage sImage = syndFeed.getImage();
    if (sImage!=null) {
        channel.setImage(createRSSImage(sImage));
    }

    List sEntries = syndFeed.getEntries();
    if (sEntries!=null) {
        channel.setItems(createRSSItems(sEntries));
    }
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ConverterForRSS090.java


示例4: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的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


示例5: parseChannel

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed parseChannel(Element rssRoot)  {
    Channel channel = (Channel) super.parseChannel(rssRoot);

    Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
    Element eCloud = eChannel.getChild("cloud",getRSSNamespace());
    if (eCloud!=null) {
        Cloud cloud = new Cloud();
        String att = eCloud.getAttributeValue("domain");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (att!=null) {
            cloud.setDomain(att);
        }
        att = eCloud.getAttributeValue("port");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (att!=null) {
            cloud.setPort(Integer.parseInt(att));
        }
        att = eCloud.getAttributeValue("path");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (att!=null) {
            cloud.setPath(att);
        }
        att = eCloud.getAttributeValue("registerProcedure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (att!=null) {
            cloud.setRegisterProcedure(att);
        }
        att = eCloud.getAttributeValue("protocol");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (att!=null) {
            cloud.setProtocol(att);
        }
        channel.setCloud(cloud);
    }
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:RSS092Parser.java


示例6: parseChannel

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed parseChannel(Element rssRoot) {
    Channel channel = (Channel) super.parseChannel(rssRoot);

    Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
    String uri = eChannel.getAttributeValue("about", getRDFNamespace());
    if (uri != null) {
        channel.setUri(uri);
    }

    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RSS10Parser.java


示例7: main

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public static void main(String[] args) {
    boolean ok = false;
    if (args.length==1) {
        try {
            URL feedUrl = new URL(args[0]);
            WireFeedInput input = new WireFeedInput();

            WireFeed feed = input.build(new XmlReader(feedUrl));

            System.out.println(feed);

            ok = true;
        }
        catch (Exception ex) {
            ex.printStackTrace();
            System.out.println("ERROR: "+ex.getMessage());
        }
    }

    if (!ok) {
        System.out.println();
        System.out.println("WireFeedReader reads and prints any RSS/Atom feed type.");
        System.out.println("The first parameter must be the URL of the feed to read.");
        System.out.println();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:WireFeedReader.java


示例8: SyndFeedImpl

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
/**
 * Creates a SyndFeedImpl and populates all its properties out of the
 * given RSS Channel or Atom Feed properties, while optionally preserving
 * the WireFeed for access via the orignalWireFeed() method.
 * 
 * @param feed
 * @param preserveWireFeed
 */
public SyndFeedImpl(WireFeed feed, boolean preserveWireFeed) {    	
    this(SyndFeed.class,IGNORE_PROPERTIES);

	if (preserveWireFeed) {    		
		this.wireFeed = feed;
		this.preserveWireFeed = preserveWireFeed;
	}
            
    if (feed!=null) {
        _feedType = feed.getFeedType();
        Converter converter = CONVERTERS.getConverter(_feedType);
        if (converter==null) {
            throw new IllegalArgumentException("Invalid feed type ["+_feedType+"]");
        }
        converter.copyInto(feed,this);
    }
    
}
 
开发者ID:4thline,项目名称:feeds,代码行数:27,代码来源:SyndFeedImpl.java


示例9: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));
    if (((List)feed.getForeignMarkup()).size() > 0) {
        syndFeed.setForeignMarkup(feed.getForeignMarkup());
    }
    syndFeed.setEncoding(feed.getEncoding());
    Channel channel = (Channel) feed;
    syndFeed.setTitle(channel.getTitle());
    syndFeed.setLink(channel.getLink());
    syndFeed.setDescription(channel.getDescription());

    Image image = channel.getImage();
    if (image!=null) {
        syndFeed.setImage(createSyndImage(image));
    }

    List items = channel.getItems();
    if (items!=null) {
        syndFeed.setEntries(createSyndEntries(items, syndFeed.isPreservingWireFeed()));
    }
}
 
开发者ID:4thline,项目名称:feeds,代码行数:22,代码来源:ConverterForRSS090.java


示例10: createRealFeed

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
@Override
protected WireFeed createRealFeed(String type, SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type, syndFeed);
    channel.setLanguage(syndFeed.getLanguage()); //c
    channel.setCopyright(syndFeed.getCopyright()); //c
    channel.setPubDate(syndFeed.getPublishedDate()); //c        

    if ((syndFeed.getAuthors() != null) && (syndFeed.getAuthors()
                                                        .size() > 0)) {
        SyndPerson author = (SyndPerson) syndFeed.getAuthors()
                                                 .get(0);
        channel.setManagingEditor(author.getName());
    }

    return channel;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:17,代码来源:ConverterForRSS091Userland.java


示例11: parseChannel

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed parseChannel(Element rssRoot)  {
    Channel channel = (Channel) super.parseChannel(rssRoot);
    Element eChannel = rssRoot.getChild("channel",getRSSNamespace());

    List eCats = eChannel.getChildren("category",getRSSNamespace());
    channel.setCategories(parseCategories(eCats));

    Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
    if (eTtl!=null && eTtl.getText() != null ) {
        Integer ttlValue = null;        
        try{
             ttlValue = new Integer(eTtl.getText());
        } catch(NumberFormatException nfe ){ 
            ; //let it go by
        }
        if (ttlValue != null) {
            channel.setTtl(ttlValue.intValue());
        }
    }

    return channel;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:23,代码来源:RSS094Parser.java


示例12: parse

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
/**
 * Parses the data from the supplied InputStream, using the supplied baseURI
 * to resolve any relative URI references.
 *
 * @param in      The InputStream from which to read the data.
 * @param baseURI The URI associated with the data in the InputStream.
 * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
 * @throws org.openrdf.rio.RDFParseException
 *                             If the parser has found an unrecoverable parse error.
 * @throws org.openrdf.rio.RDFHandlerException
 *                             If the configured statement handler has encountered an
 *                             unrecoverable error.
 */
@Override
public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
    Preconditions.checkNotNull(baseURI);

    setBaseURI(baseURI);

    WireFeedInput input = new WireFeedInput();
    try {
        WireFeed feed = input.build(new InputSource(in));
        if(feed instanceof Channel) {
            parseFeed((Channel) feed);
        } else {
            throw new RDFParseException("data stream is not an RSS feed");
        }
    } catch (FeedException e) {
        throw new RDFParseException(e);
    }
}
 
开发者ID:apache,项目名称:marmotta,代码行数:32,代码来源:RSSParser.java


示例13: parse

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
/**
 * Parses the data from the supplied InputStream, using the supplied baseURI
 * to resolve any relative URI references.
 *
 * @param in      The InputStream from which to read the data.
 * @param baseURI The URI associated with the data in the InputStream.
 * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
 * @throws org.openrdf.rio.RDFParseException
 *                             If the parser has found an unrecoverable parse error.
 * @throws org.openrdf.rio.RDFHandlerException
 *                             If the configured statement handler has encountered an
 *                             unrecoverable error.
 */
@Override
public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
    Preconditions.checkNotNull(baseURI);

    setBaseURI(baseURI);

    WireFeedInput input = new WireFeedInput();
    try {
        WireFeed feed = input.build(new InputSource(in));
        if(feed instanceof Feed) {
            parseFeed((Feed) feed);
        } else {
            throw new RDFParseException("data stream is not an RSS feed");
        }
    } catch (FeedException e) {
        throw new RDFParseException(e);
    }
}
 
开发者ID:apache,项目名称:marmotta,代码行数:32,代码来源:AtomParser.java


示例14: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));
    if (((List)feed.getForeignMarkup()).size() > 0) {
        syndFeed.setForeignMarkup(feed.getForeignMarkup());
    }
    syndFeed.setEncoding(feed.getEncoding());
    Channel channel = (Channel) feed;
    syndFeed.setTitle(channel.getTitle());
    syndFeed.setLink(channel.getLink());
    syndFeed.setDescription(channel.getDescription());

    Image image = channel.getImage();
    if (image!=null) {
        syndFeed.setImage(createSyndImage(image));
    }

    List items = channel.getItems();
    if (items!=null) {
        syndFeed.setEntries(createSyndEntries(items));
    }
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:22,代码来源:ConverterForRSS090.java


示例15: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的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


示例16: SyndFeedImpl

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
/**
 * Creates a SyndFeedImpl and populates all its properties out of the
 * given RSS Channel or Atom Feed properties.
 * <p>
 * @param feed the RSS Channel or the Atom Feed to populate the properties from.
 *
 */
public SyndFeedImpl(WireFeed feed) {
    this(SyndFeed.class,IGNORE_PROPERTIES);
    if (feed!=null) {
        _feedType = feed.getFeedType();
        Converter converter = CONVERTERS.getConverter(_feedType);
        if (converter==null) {
            throw new IllegalArgumentException("Invalid feed type ["+_feedType+"]");
        }
        converter.copyInto(feed,this);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:SyndFeedImpl.java


示例17: createWireFeed

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
/**
 * Creates a real feed containing the information of the SyndFeedImpl.
 * <p>
 * @param feedType the feed type for the WireFeed to be created.
 * @return the real feed.
 *
 */
public WireFeed createWireFeed(String feedType) {
    if (feedType==null) {
        throw new IllegalArgumentException("Feed type cannot be null");
    }
    Converter converter = CONVERTERS.getConverter(feedType);
    if (converter==null) {
        throw new IllegalArgumentException("Invalid feed type ["+feedType+"]");
    }
    return converter.createRealFeed(this);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:SyndFeedImpl.java


示例18: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Channel channel = (Channel) feed;
    super.copyInto(channel,syndFeed);
    if (channel.getUri() != null) {
    	syndFeed.setUri(channel.getUri());
    } else {
    	// if URI is not set use the value for link
    	syndFeed.setUri(channel.getLink());
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:ConverterForRSS10.java


示例19: createRealFeed

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type,syndFeed);        
    if (syndFeed.getUri() != null) {
    	channel.setUri(syndFeed.getUri());
    } else {
    	// if URI is not set use the value for link
    	channel.setUri(syndFeed.getLink());
    }
    
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:ConverterForRSS10.java


示例20: copyInto

import com.sun.syndication.feed.WireFeed; //导入依赖的package包/类
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
    Channel channel = (Channel) feed;
    super.copyInto(channel,syndFeed);
    List cats = channel.getCategories();    //c
    if (cats.size()>0) {
        Set s = new HashSet();                // using a set to remove duplicates
        s.addAll(createSyndCategories(cats)); // feed native categories (as syndcat)
        s.addAll(syndFeed.getCategories());   // DC subjects (as syndcat)
        syndFeed.setCategories(new ArrayList(s));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:ConverterForRSS094.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Util类代码示例发布时间:2022-05-22
下一篇:
Java OFStatsReplyFlagsSerializerVer13类代码示例发布时间: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