Package com.rometools.rome.feed.synd

Examples of com.rometools.rome.feed.synd.SyndLink


    if (foreignMarkup == null) {
      return;
    }
    for (Element element : foreignMarkup) {
      if ("link".equals(element.getName()) && ATOM_10_NS.equals(element.getNamespace())) {
        SyndLink link = new SyndLinkImpl();
        link.setRel(element.getAttributeValue("rel"));
        link.setHref(element.getAttributeValue("href"));
        feed.getLinks().add(link);
      }
    }
  }
View Full Code Here


            guid.setValue(link);

        }
        item.setGuid(guid);

        final SyndLink comments = sEntry.findRelatedLink("comments");
        if (comments != null && (comments.getType() == null || comments.getType().endsWith("html"))) {
            item.setComments(comments.getHref());
        }
        return item;

    }
View Full Code Here

    protected List<SyndLink> createSyndLinks(final List<Link> atomLinks) {
        final ArrayList<SyndLink> syndLinks = new ArrayList<SyndLink>();
        for (final Link atomLink : atomLinks) {
            final Link link = atomLink;
            if (!link.getRel().equals("enclosure")) {
                final SyndLink syndLink = createSyndLink(link);
                syndLinks.add(syndLink);
            }
        }
        return syndLinks;
    }
View Full Code Here

        }
        return syndLinks;
    }

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

        final List<Link> otherLinks = new ArrayList<Link>();

        final List<SyndLink> slinks = syndFeed.getLinks();
        if (slinks != null) {
            for (final SyndLink syndLink2 : slinks) {
                final SyndLink syndLink = syndLink2;
                final Link link = createAtomLink(syndLink);
                final String rel = link.getRel();
                if (Strings.isBlank(rel) || "alternate".equals(rel)) {
                    alternateLinks.add(link);
                } else {
View Full Code Here

    }

    protected List<SyndLink> createSyndLinks(final List<Link> atomLinks) {
        final ArrayList<SyndLink> syndLinks = new ArrayList<SyndLink>();
        for (final Link atomLink : atomLinks) {
            final SyndLink syndLink = createSyndLink(atomLink);
            syndLinks.add(syndLink);
        }
        return syndLinks;
    }
View Full Code Here

        link.setLength(syndEnclosure.getLength());
        return link;
    }

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

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

            assertEquals("http://example.com/blog/entry1_plain", links.get(1).getHref());
            assertEquals("text/plain", links.get(1).getType());

            final SyndLink slink = entry.getLinks().get(3);
            assertTrue(slink.getHref().startsWith("tag:"));
        } else {
            final SyndLink slink = entry.getLinks().get(2);
            assertTrue(slink.getHref().startsWith("tag:"));

        }
    }
View Full Code Here

TOP

Related Classes of com.rometools.rome.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.