Package org.apache.abdera.model

Examples of org.apache.abdera.model.Link


    return link;   
  }
 
  public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException {
    FOMFactory fomfactory = (FOMFactory) factory;
    Link link = fomfactory.newLink(this);
    link.setHref(href);
    link.setRel(rel);
    link.setMimeType(type);
    link.setTitle(title);
    link.setHrefLang(hreflang);
    link.setLength(length);
    return link;
  }
View Full Code Here


        URIHelper.isMailtoUri(uri)) ? null : uri;
  }
 
  public Link getLink(String rel) {
    List<Link> self = getLinks(rel);
    Link link = null;
    if (self.size() > 0) link = self.get(0);
    return link;
  }
View Full Code Here

  public Link getAlternateLink() {
    return getLink(Link.REL_ALTERNATE);
  }

  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
    Link link = getLink(rel);
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
    Link link = getLink(rel);
    return (link != null) ? link.getResolvedHref() : null;
  }
  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
  public IRI getAlternateLinkResolvedHref() throws IRISyntaxException {
    Link link = getAlternateLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getAlternateLinkResolvedHref(
    String type,
    String hreflang)
      throws IRISyntaxException,
             MimeTypeParseException {
    Link link = getAlternateLink(type, hreflang);
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

    IRI uri = baseURI.resolve("2/infoset-element-whitespace.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Feed feed = doc.getRoot();
    assertNotNull(feed);
    Link link = feed.getAlternateLink();
    assertEquals(link.getResolvedHref(), new IRI("http://example.org/"));
    // the feed has a second alternate link that we will ignore
  }
View Full Code Here

  public static void testSection411LinkRelFull() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.1/link-rel-full.xml
    IRI uri = baseURI.resolve("4.1.1/link-rel-full.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Link link = doc.getRoot().getLink("http://xmlns.com/foaf/0.1/");
    assertNotNull(link);
    assertEquals(link.getResolvedHref(), new IRI("http://example.org/foaf"));
  }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.7.1/link-no-href.xml
     IRI uri = baseURI.resolve("4.2.7.1/link-no-href.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Link link = entry.getLinks().get(0);
     assertNull(link.getHref());
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.7.2/link-rel-relative.xml
     IRI uri = baseURI.resolve("4.2.7.2/link-rel-relative.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Link link = entry.getLink("/foo");
     assertNotNull(link)// we don't care that it's invalid
   }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Link

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.