Package com.sun.syndication.feed.synd

Examples of com.sun.syndication.feed.synd.SyndLink


        Date d = DateParser.parseW3CDateTime("2000-0"+(i+1)+"-01T01:00:00Z");
        assertEquals(entry.getPublishedDate(),d);
        assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
        assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
        assertEquals(1, ((List)entry.getForeignMarkup()).size());
        SyndLink slink = (SyndLink)entry.getLinks().get(2);
        assertTrue(slink.getHref().startsWith("tag:"));
    }
View Full Code Here


    protected List createSyndLinks(List aLinks) {
        ArrayList sLinks = new ArrayList();
        for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
            Link link = (Link)iter.next();
            SyndLink sLink = new SyndLinkImpl();
            sLink.setHref(     link.getHref());
            sLink.setType(     link.getType());
            sLink.setLength(   link.getLength());
            sLink.setHreflang( link.getHref());
            sLinks.add(sLink);
        }
        return sLinks;
    }
View Full Code Here

        return syndEntry;
    }
   
    public SyndLink createSyndLink(Feed feed, Entry entry, Link link) {
        SyndLink syndLink = new SyndLinkImpl();
        syndLink.setRel(link.getRel());
        syndLink.setType(link.getType());
        syndLink.setHref(link.getHref());
        syndLink.setHreflang(link.getHreflang());
        syndLink.setLength(link.getLength());
        return syndLink;
    }
View Full Code Here

        List otherLinks = new ArrayList();
        String sLink = syndFeed.getLink();
        List slinks = syndFeed.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = new Link();
                link.setRel(syndLink.getRel());
                link.setHref(syndLink.getHref());
                link.setHreflang(syndLink.getHreflang());
                link.setLength(syndLink.getLength());               
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(syndLink.getRel())) {
                    alternateLinks.add(link);
                } else {
                    otherLinks.add(link);
                }
            }
View Full Code Here

        List alternateLinks = new ArrayList();
        List otherLinks = new ArrayList();
        List slinks = sEntry.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = new Link();
                link.setRel(syndLink.getRel());
                link.setHref(syndLink.getHref());
                link.setHreflang(syndLink.getHreflang());
                link.setLength(syndLink.getLength());               
                link.setType(syndLink.getType());
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(syndLink.getRel())) {
                    alternateLinks.add(link);
                } else {
                    otherLinks.add(link);
                }
            }
View Full Code Here

    protected List createSyndLinks(List aLinks) {
        ArrayList sLinks = new ArrayList();
        for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
            Link link = (Link)iter.next();
            SyndLink sLink = createSyndLink(link);
            sLinks.add(sLink);
        }
        return sLinks;
    }
View Full Code Here

      link.setLengthsyndEnclosure.getLength());
      return link;
    }

    public SyndLink createSyndLink(Link link) {
        SyndLink syndLink = new SyndLinkImpl();
        syndLink.setRel(     link.getRel());
        syndLink.setType(    link.getType());
        syndLink.setHref(    link.getHrefResolved());
        syndLink.setHreflang(link.getHreflang());
        syndLink.setLengthlink.getLength());
        syndLink.setTitle(   link.getTitle());
        return syndLink;
    }
View Full Code Here

        List alternateLinks = new ArrayList();
        List otherLinks = new ArrayList();
        List slinks = syndFeed.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = createAtomLink(syndLink);             
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(link.getRel())) {
                    alternateLinks.add(link);
View Full Code Here

        List slinks = sEntry.getLinks();
        List enclosures = sEntry.getEnclosures();
        boolean linkRelEnclosureExists = false;
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = createAtomLink(syndLink);
                // Set this flag if there's a link of rel = enclosure so that
                // enclosures won't be duplicated when pulled from
                // SyndEntry.getEnclosures()
                if (syndLink.getRel() != null &&
                        "enclosure".equals(syndLink.getRel())) {
                    linkRelEnclosureExists = true;
                }
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(syndLink.getRel())) {
                    alternateLinks.add(link);
                } else {
                    otherLinks.add(link);
                }
            }
View Full Code Here

            assertEquals("text/html", ((SyndLink)links.get(0)).getType());

            assertEquals("http://example.com/blog/entry1_plain", ((SyndLink)links.get(1)).getHref());
            assertEquals("text/plain", ((SyndLink)links.get(1)).getType());
           
            SyndLink slink = (SyndLink)entry.getLinks().get(3);
            assertTrue(slink.getHref().startsWith("tag:"));       
        } else {
            SyndLink slink = (SyndLink)entry.getLinks().get(2);
            assertTrue(slink.getHref().startsWith("tag:"));       
           
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.