Lizzy v1.1.1

christophedelory.atom
Class Link

java.lang.Object
  extended by christophedelory.atom.Common
      extended by christophedelory.atom.Type
          extended by christophedelory.atom.Link

public class Link
extends Type

A reference from an entry or feed to a Web resource.
Note: the "type" attribute's value here is an advisory media type: it is a hint about the type of the representation that is expected to be returned when the value of the href attribute is dereferenced. Note that the type attribute does not override the actual media type returned with the representation. The value must conform to the syntax of a MIME media type.

Version:
$Revision: 92 $
Author:
Christophe Delory

Constructor Summary
Link()
           
 
Method Summary
 String getHref()
          Returns the link's URI.
 String getHrefLang()
          Returns the language of the resource pointed to by the href attribute.
 Long getLength()
          Returns an advisory length of the linked content in octets.
 String getRel()
          Returns the link relation type.
 String getTitle()
          Returns human-readable information about the link.
 void setHref(String href)
          Initializes the link's URI.
 void setHrefLang(String hreflang)
          Initializes the language of the resource pointed to by the href attribute.
 void setLength(Long length)
          Initializes an advisory length of the linked content in octets.
 void setRel(String rel)
          Initializes the link relation type.
 void setTitle(String title)
          Initializes human-readable information about the link.
 
Methods inherited from class christophedelory.atom.Type
getType, setType
 
Methods inherited from class christophedelory.atom.Common
getBaseString, getLang, setBaseString, setLang
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Link

public Link()
Method Detail

getHref

public String getHref()
Returns the link's URI. No default value.

Returns:
an URI as a string. May be null if not yet initialized.
See Also:
setHref(java.lang.String)

setHref

public void setHref(String href)
Initializes the link's URI.

Parameters:
href - an URI as a string. Shall not be null.
Throws:
NullPointerException - if href is null.
See Also:
getHref()

getRel

public String getRel()
Returns the link relation type. If missing, must be interpreted as if the link relation type is "alternate".
Five initial values are defined:
  1. The value "alternate" signifies that the URI in the value of the href attribute identifies an alternate version of the resource described by the containing element.
  2. The value "related" signifies that the URI in the value of the href attribute identifies a resource related to the resource described by the containing element. For example, the feed for a site that discusses the performance of the search engine at "http://search.example.com" might contain, as a child of the feed element:
     <link rel="related" href="http://search.example.com/"/>
     
    An identical link might appear as a child of any entry elements whose content contains a discussion of that same search engine.
  3. The value "self" signifies that the URI in the value of the href attribute identifies a resource equivalent to the containing element.
  4. The value "enclosure" signifies that the URI in the value of the href attribute identifies a related resource that is potentially large in size and might require special handling. For link elements with rel="enclosure", the length attribute should be provided.
  5. The value "via" signifies that the URI in the value of the href attribute identifies a resource that is the source of the information provided in the containing element.

Returns:
a relation type. May be null if not yet initialized.
See Also:
setRel(java.lang.String)

setRel

public void setRel(String rel)
Initializes the link relation type.

Parameters:
rel - a relation type. May be null.
See Also:
setRel(java.lang.String)

getHrefLang

public String getHrefLang()
Returns the language of the resource pointed to by the href attribute. When used together with the rel="alternate", it implies a translated version of the entry.

Returns:
a language tag. May be null.
See Also:
setHrefLang(java.lang.String)

setHrefLang

public void setHrefLang(String hreflang)
Initializes the language of the resource pointed to by the href attribute.

Parameters:
hreflang - a language tag. May be null.
See Also:
setHrefLang(java.lang.String)

getTitle

public String getTitle()
Returns human-readable information about the link.

Returns:
a title. May be null.
See Also:
setTitle(java.lang.String)

setTitle

public void setTitle(String title)
Initializes human-readable information about the link.

Parameters:
title - a title. May be null.
See Also:
getTitle()

getLength

public Long getLength()
Returns an advisory length of the linked content in octets.

Returns:
a length. May be null.
See Also:
setLength(java.lang.Long)

setLength

public void setLength(Long length)
Initializes an advisory length of the linked content in octets.

Parameters:
length - a length. May be null.
See Also:
getLength()

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.