Class Link


  • public class Link
    extends java.lang.Object
    Defines a reference from an entry or feed to a Web resource.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Content content
      Contains or links to the content of the entry.
      private Reference href
      The link's IRI.
      private Language hrefLang
      Language of the resource pointed to by the href attribute.
      private long length
      Advisory length of the linked content in octets.
      private Relation rel
      The link's relation type.
      private java.lang.String title
      Human-readable information about the link.
      private MediaType type
      Advisory media type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Content getContent()
      Returns the content of the entry or links to it.
      Reference getHref()
      Returns the link's IRI.
      Language getHrefLang()
      Returns the language of the resource pointed to by the href attribute.
      long getLength()
      Returns the advisory length of the linked content in octets.
      Relation getRel()
      Returns the link's relation type.
      java.lang.String getTitle()
      Returns the human-readable information about the link.
      MediaType getType()
      Returns the advisoty media type.
      void setContent​(Content content)
      Sets the content of the entry or links to it.
      void setHref​(Reference href)
      Sets the link's IRI.
      void setHrefLang​(Language hrefLang)
      Sets the language of the resource pointed to by the href attribute.
      void setLength​(long length)
      Sets the advisory length of the linked content in octets.
      void setRel​(Relation rel)
      Sets the link's relation type.
      void setTitle​(java.lang.String title)
      Sets the human-readable information about the link.
      void setType​(MediaType type)
      Sets the advisoty media type.
      void writeElement​(XmlWriter writer)
      Writes the current object as an XML element using the given SAX writer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • content

        private volatile Content content
        Contains or links to the content of the entry.
      • href

        private volatile Reference href
        The link's IRI.
      • hrefLang

        private volatile Language hrefLang
        Language of the resource pointed to by the href attribute.
      • length

        private volatile long length
        Advisory length of the linked content in octets.
      • rel

        private volatile Relation rel
        The link's relation type.
      • title

        private volatile java.lang.String title
        Human-readable information about the link.
      • type

        private volatile MediaType type
        Advisory media type.
    • Constructor Detail

      • Link

        public Link()
        Constructor.
      • Link

        public Link​(Reference href,
                    Relation rel,
                    MediaType type)
        Constructor.
        Parameters:
        href - The link's IRI.
        rel - The link's relation type.
        type - Advisory media type.
    • Method Detail

      • getContent

        public Content getContent()
        Returns the content of the entry or links to it.
        Returns:
        The content of the entry or links to it.
      • getHref

        public Reference getHref()
        Returns the link's IRI.
        Returns:
        The link's IRI.
      • getHrefLang

        public Language getHrefLang()
        Returns the language of the resource pointed to by the href attribute.
        Returns:
        The language of the resource pointed to by the href attribute.
      • getLength

        public long getLength()
        Returns the advisory length of the linked content in octets.
        Returns:
        The advisory length of the linked content in octets.
      • getRel

        public Relation getRel()
        Returns the link's relation type.
        Returns:
        The link's relation type.
      • getTitle

        public java.lang.String getTitle()
        Returns the human-readable information about the link.
        Returns:
        The human-readable information about the link.
      • getType

        public MediaType getType()
        Returns the advisoty media type.
        Returns:
        The advisoty media type.
      • setContent

        public void setContent​(Content content)
        Sets the content of the entry or links to it.
        Parameters:
        content - The content of the entry or links to it.
      • setHref

        public void setHref​(Reference href)
        Sets the link's IRI.
        Parameters:
        href - The link's IRI.
      • setHrefLang

        public void setHrefLang​(Language hrefLang)
        Sets the language of the resource pointed to by the href attribute.
        Parameters:
        hrefLang - The language of the resource pointed to by the href attribute.
      • setLength

        public void setLength​(long length)
        Sets the advisory length of the linked content in octets.
        Parameters:
        length - The advisory length of the linked content in octets.
      • setRel

        public void setRel​(Relation rel)
        Sets the link's relation type.
        Parameters:
        rel - The link's relation type.
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the human-readable information about the link.
        Parameters:
        title - The human-readable information about the link.
      • setType

        public void setType​(MediaType type)
        Sets the advisoty media type.
        Parameters:
        type - The advisoty media type.
      • writeElement

        public void writeElement​(XmlWriter writer)
                          throws org.xml.sax.SAXException
        Writes the current object as an XML element using the given SAX writer.
        Parameters:
        writer - The SAX writer.
        Throws:
        org.xml.sax.SAXException