Package org.apache.abdera.model

Examples of org.apache.abdera.model.Link


 
  /**
   * Returns the IRI of the first link relation
   */
  public static IRI getFirst(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("first");
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here


 
  /**
   * Returns the IRI of the last link relation
   */
  public static IRI getLast(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("last");
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

 
  /**
   * Returns the IRI of the prev-archive link relation
   */
  public static IRI getPreviousArchive(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("prev-archive");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "prev-archive");
    }
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

 
  /**
   * Returns the IRI of the next-archive link relation
   */
  public static IRI getNextArchive(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("next-archive");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "next-archive");
    }
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

 
  /**
   * Returns the IRI of the current link relation
   */
  public static IRI getCurrent(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("current");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "current");
    }
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.7.5/link-title-with-badchars.xml
     IRI uri = baseURI.resolve("4.2.7.5/link-title-with-badchars.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Link link = entry.getAlternateLink();
     assertEquals(link.getTitle(),"This is a \u00A3\u0093test.\u0094");
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.7.5/link-title-with-html.xml
     IRI uri = baseURI.resolve("4.2.7.5/link-title-with-html.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Link link = entry.getAlternateLink();
     assertEquals(link.getTitle(),"very, <b>very</b>, scary indeed");
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.7.6/link-length-not-positive.xml
     IRI uri = baseURI.resolve("4.2.7.6/link-length-not-positive.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Link link = entry.getAlternateLink();
     assertEquals(link.getLength(),0);
   }
View Full Code Here

    return addLink(href, null);
  }
 
  public Link addLink(String href, String rel) throws IRISyntaxException {
    FOMFactory fomfactory = (FOMFactory) factory;
    Link link = fomfactory.newLink(this);
    link.setHref(href);
    if (rel != null) link.setRel(rel);
    return link;   
  }
View Full Code Here

    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

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.