Class Link
Atom links define references to related resources such as alternate representations, related documents, enclosures (for podcasts), and navigation links. Links are one of the fundamental components of Atom and enable rich hypermedia relationships between resources.
 The link's 
- alternate - An alternate representation (e.g., HTML version of entry)
- self - The feed/entry itself
- related - A related resource
- enclosure - A related resource to be downloaded (e.g., podcast audio)
- via - The source of the information
Schema
atomLink = element atom:link { atomCommonAttributes, attribute href { atomUri }, attribute rel { atomNCName | atomUri }?, attribute type { atomMediaType }?, attribute hreflang { atomLanguageTag }?, attribute title { text }?, attribute length { text }?, undefinedContent }
Example:
   
Specification:
 Represents an 
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetHref()Bean property getter:href .Bean property getter:hreflang .Bean property getter:length .getRel()Bean property getter:rel .getTitle()Bean property getter:title .getType()Bean property getter:type .Bean property setter:base .Bean property setter:href .setHreflang(String value) Bean property setter:hreflang .Bean property setter:lang .Bean property setter:length .Bean property setter:rel .Bean property setter:title .Bean property setter:type .
- 
Constructor Details- 
LinkNormal constructor.- Parameters:
- rel- The rel of the link.
- type- The type of the link.
- href- The URI of the link.
 
- 
Linkpublic Link()Bean constructor.
 
- 
- 
Method Details- 
getHrefBean property getter:href .Returns the URI of the referenced resource. This is the target address of the link and is a required attribute for all Atom links. - Returns:
- The property value, or null if it is not set.
 
- 
setHrefBean property setter:href .Sets the URI of the referenced resource (required). Example:Link link =new Link() .setHref("http://example.org/posts/1" );- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getRelBean property getter:rel .Returns the link relation type. The rel attribute indicates the type of relationship between the entry/feed and the linked resource. When not specified, the default is "alternate".- Returns:
- The property value, or null if it is not set.
 
- 
setRelBean property setter:rel .Sets the link relation type. Common values include "alternate" ,"self" ,"related" ,"enclosure" ,"via" ,"first" ,"last" ,"previous" ,"next" .Example:Link link =new Link() .setRel("alternate" ) .setHref("http://example.org/post1.html" );- Parameters:
- value- The new value for this property.
 Can be- null to unset the property (defaults to "alternate").
- Returns:
- This object.
 
- 
getTypeBean property getter:type .The content type of the target of this link. - Returns:
- The property value, or null if it is not set.
 
- 
setTypeBean property setter:type .The content type of the target of this link. This should be a valid MIME media type as defined by RFC 4287. Examples:- "text/html" 
- "application/pdf" 
- "image/jpeg" 
- "application/atom+xml" 
 - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getHreflangBean property getter:hreflang .Returns the language of the resource pointed to by the link. The value should be a language tag as defined by RFC 3066. - Returns:
- The property value, or null if it is not set.
 
- 
setHreflangBean property setter:hreflang .Sets the language of the resource pointed to by the link. Example:Link link =new Link("alternate" ,"text/html" ,"http://example.org/post1.html" ) .setHreflang("en-US" );- Parameters:
- value- The new value for this property (e.g., "en", "fr", "de", "en-US").
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getTitleBean property getter:title .Returns human-readable information about the link. The title provides advisory information about the link, typically for display to users. - Returns:
- The property value, or null if it is not set.
 
- 
setTitleBean property setter:title .Sets human-readable information about the link. Example:Link link =new Link("related" ,"text/html" ,"http://example.org/related" ) .setTitle("Related Article" );- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getLengthBean property getter:length .Returns an advisory size in bytes of the linked resource. This is particularly useful for enclosures (podcast episodes, video files, etc.) to help clients decide whether to download the resource. - Returns:
- The property value, or null if it is not set.
 
- 
setLengthBean property setter:length .Sets an advisory size in bytes of the linked resource. Example:// Podcast episode with file size Linklink =new Link("enclosure" ,"audio/mpeg" ,"http://example.org/episode1.mp3" ) .setLength(24986239);// ~24 MB - Parameters:
- value- The new value for this property in bytes.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
setBaseDescription copied from class:Common
- 
setLangDescription copied from class:CommonBean property setter:lang .Sets the natural language of the element's content (xml:lang attribute). Example:Text title =new Text("text" ) .setText("Mon Blog" ) .setLang("fr" );
 
-