com.google.gdata.model.atom
Class Link

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.atom.Link
All Implemented Interfaces:
ILink, Reference

public class Link
extends Element
implements ILink

Class representing atom:link.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.gdata.data.ILink
ILink.Rel, ILink.Type
 
Field Summary
static AttributeKey<java.lang.String> ETAG
          The etag attribute.
static AttributeKey<java.lang.String> HREF
          The href attribute.
static AttributeKey<java.lang.String> HREFLANG
          The hreflang attribute.
static ElementKey<java.lang.Void,Link> KEY
          The key for this element.
static AttributeKey<java.lang.Long> LENGTH
          The length attribute.
static AttributeKey<java.lang.String> REL
          The rel attribute.
static AttributeKey<java.lang.String> TITLE
          The title attribute.
static AttributeKey<java.lang.String> TYPE
          The type attribute.
static AttributeKey<java.lang.String> XML_LANG
          The xml:lang attribute.
 
Constructor Summary
Link()
          Constructs a new instance using the default metadata.
Link(java.lang.String rel, java.lang.String type, java.lang.String href)
          Deprecated. Use Link(String, String, URI) instead.
Link(java.lang.String rel, java.lang.String type, java.net.URI href)
          Constructs a new instance using the default metadata, and setting the links rel, type, and href attributes.
 
Method Summary
 Content getContent()
          Return the content of the link, or null if no content has been set.
 java.lang.String getEtag()
          Etag of linked resource or null if unknown.
 java.lang.String getHref()
          Link URI.
 java.lang.String getHrefLang()
          Language of resource pointed to by href.
 java.net.URI getHrefUri()
           
 long getLength()
           
 java.lang.String getRel()
          Link relation type.
 java.lang.String getTitle()
          Link title.
 java.lang.String getTitleLang()
          Language of link title.
 java.lang.String getType()
          MIME type of the link target.
 boolean matches(java.lang.String relToMatch, java.lang.String typeToMatch)
          Returns whether this link matches the given rel and type values.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 void setContent(Content c)
          Sets the atom:content element nested inside this atom:link.
 void setEtag(java.lang.String v)
           
 void setHref(java.lang.String v)
          Sets the value of the resource reference.
 void setHref(java.net.URI v)
           
 void setHrefLang(java.lang.String v)
           
 void setLength(long v)
           
 void setRel(java.lang.String v)
          Sets the link relation type.
 void setTitle(java.lang.String v)
           
 void setTitleLang(java.lang.String v)
           
 void setType(java.lang.String v)
          Sets the mime type of the link.
 
Methods inherited from class com.google.gdata.model.Element
addElement, addElement, addElement, clear, createElement, createElement, equals, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hashCode, hasTextValue, isLocked, lock, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, visit
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.Void,Link> KEY
The key for this element.


HREF

public static final AttributeKey<java.lang.String> HREF
The href attribute.


REL

public static final AttributeKey<java.lang.String> REL
The rel attribute.


TYPE

public static final AttributeKey<java.lang.String> TYPE
The type attribute.


HREFLANG

public static final AttributeKey<java.lang.String> HREFLANG
The hreflang attribute.


TITLE

public static final AttributeKey<java.lang.String> TITLE
The title attribute.


XML_LANG

public static final AttributeKey<java.lang.String> XML_LANG
The xml:lang attribute.


LENGTH

public static final AttributeKey<java.lang.Long> LENGTH
The length attribute.


ETAG

public static final AttributeKey<java.lang.String> ETAG
The etag attribute.

Constructor Detail

Link

public Link()
Constructs a new instance using the default metadata.


Link

@Deprecated
public Link(java.lang.String rel,
                       java.lang.String type,
                       java.lang.String href)
Deprecated. Use Link(String, String, URI) instead.

Constructs a new instance using the default metadata, and setting the links rel, type, and href attributes.


Link

public Link(java.lang.String rel,
            java.lang.String type,
            java.net.URI href)
Constructs a new instance using the default metadata, and setting the links rel, type, and href attributes.

Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


getRel

public java.lang.String getRel()
Link relation type. Possible values include self, prev, next, enclosure, etc.

Specified by:
getRel in interface ILink
See Also:
ILink.Rel

setRel

public void setRel(java.lang.String v)
Description copied from interface: ILink
Sets the link relation type.

Specified by:
setRel in interface ILink

getType

public java.lang.String getType()
MIME type of the link target.

Specified by:
getType in interface ILink

setType

public void setType(java.lang.String v)
Description copied from interface: ILink
Sets the mime type of the link.

Specified by:
setType in interface ILink

getHref

public java.lang.String getHref()
Link URI.

Specified by:
getHref in interface Reference

getHrefUri

public java.net.URI getHrefUri()

setHref

public void setHref(java.lang.String v)
Description copied from interface: Reference
Sets the value of the resource reference.

Specified by:
setHref in interface Reference
Parameters:
v - the resource href.

setHref

public void setHref(java.net.URI v)

getHrefLang

public java.lang.String getHrefLang()
Language of resource pointed to by href.


setHrefLang

public void setHrefLang(java.lang.String v)

getTitle

public java.lang.String getTitle()
Link title.


setTitle

public void setTitle(java.lang.String v)

getTitleLang

public java.lang.String getTitleLang()
Language of link title.


setTitleLang

public void setTitleLang(java.lang.String v)

getLength

public long getLength()

setLength

public void setLength(long v)

getEtag

public java.lang.String getEtag()
Etag of linked resource or null if unknown.


setEtag

public void setEtag(java.lang.String v)

getContent

public Content getContent()
Return the content of the link, or null if no content has been set. This is used to inline an atom:content element inside an atom:link element.

Returns:
the atom:content element, or null if none exists.

setContent

public void setContent(Content c)
Sets the atom:content element nested inside this atom:link.

Parameters:
c - the content to place inside the link.

matches

public boolean matches(java.lang.String relToMatch,
                       java.lang.String typeToMatch)
Returns whether this link matches the given rel and type values.

Parameters:
relToMatch - rel value to match or null to match any rel value.
typeToMatch - type value to match or null to match any type value.