# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data
Class Link

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.Link

All Implemented Interfaces:
  Extension, ILink, Reference

Direct Known Subclasses:
  AnalyticsLink, EntryLink, FeedLink, IssuesLink, SitesLink

    public class Link

extends ExtensionPoint
implements ILink

External link type.

Nested Class Summary
`class` `Link.AtomHandler` <atom:link> parser.

Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
`ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler`

Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
`AbstractExtension.AttributesHandler`

Nested classes/interfaces inherited from interface com.google.gdata.data.ILink
`ILink.Rel, ILink.Type`

Field Summary
`protected Content` `content` Nested atom:content element or `null` if no inlined link content.
`protected java.lang.String` `etag` Etag of linked resource, or `null` if unknown
`protected java.lang.String` `href` Link URI.
`protected java.lang.String` `hrefLang` Language of resource pointed to by href.
`protected long` `length` Length of the resource pointed to by href, in bytes.
`protected java.lang.String` `rel` Link relation type.
`protected java.lang.String` `title` Link title.
`protected java.lang.String` `titleLang` Language of link title.
`protected java.lang.String` `type` MIME type of the link target.

Fields inherited from class com.google.gdata.data.ExtensionPoint
`xmlBlob`

Fields inherited from class com.google.gdata.data.AbstractExtension
`localName, namespace`

Constructor Summary
`Link()`
`Link(java.lang.String rel, java.lang.String type, java.lang.String href)`

Method Summary
`void` `generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile p)` Generates an XML representation for the extension.
`void` `generateAtom(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)` Generates XML in the Atom format.
`void` `generateRss(com.google.gdata.util.common.xml.XmlWriter w)` Generates XML in the RSS format.
`Content` `getContent()`
`java.lang.String` `getEtag()`
`XmlParser.ElementHandler` `getHandler(ExtensionProfile p, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)` The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.
`java.lang.String` `getHref()` Returns the value of the resource reference.
`java.lang.String` `getHrefLang()`
`long` `getLength()`
`java.lang.String` `getRel()` Returns the link relation type.
`java.lang.String` `getTitle()`
`java.lang.String` `getTitleLang()`
`java.lang.String` `getType()` Returns the mime type of the link.
`boolean` `matches(java.lang.String relToMatch, java.lang.String typeToMatch)` Returns whether this link matches the given `rel` and `type` values.
`void` `setContent(Content c)`
`void` `setEtag(java.lang.String v)`
`void` `setHref(java.lang.String v)` Sets the value of the resource reference.
`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.data.ExtensionPoint

`addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren`

Methods inherited from class com.google.gdata.data.AbstractExtension
`consumeAttributes, disableStrictValidation, enableStrictValidation, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### rel

    protected java.lang.String rel

  Link relation type. Possible values include `self`, `prev`, `next`, `enclosure`, etc.

### type

    protected java.lang.String type

  MIME type of the link target.

### href

    protected java.lang.String href

  Link URI.

### hrefLang

    protected java.lang.String hrefLang

  Language of resource pointed to by href.

### title

    protected java.lang.String title

  Link title.

### titleLang

    protected java.lang.String titleLang

  Language of link title.

### length

    protected long length

  Length of the resource pointed to by href, in bytes.

### content

    protected Content content

  Nested atom:content element or `null` if no inlined link content.

### etag

    protected java.lang.String etag

  Etag of linked resource, or `null` if unknown

Constructor Detail

### Link

    public Link()

### Link

    public Link(java.lang.String rel,
                java.lang.String type,
                java.lang.String href)

Method Detail

### getRel

    public java.lang.String getRel()

  Description copied from interface: `ILink`
  Returns the link relation type. Common values are defined in the `ILink.Rel` class.

  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()

  Description copied from interface: `ILink`
  Returns the mime type of the link.

  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()

  Description copied from interface: `Reference`
  Returns the value of the resource reference.

  Specified by:
    `getHref` in interface `Reference`

### 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.

### getHrefLang

    public java.lang.String getHrefLang()

### setHrefLang

    public void setHrefLang(java.lang.String v)

### getTitle

    public java.lang.String getTitle()

### setTitle

    public void setTitle(java.lang.String v)

### getTitleLang

    public java.lang.String getTitleLang()

### setTitleLang

    public void setTitleLang(java.lang.String v)

### getLength

    public long getLength()

### setLength

    public void setLength(long v)

### getContent

    public Content getContent()

### setContent

    public void setContent(Content c)

### getEtag

    public java.lang.String getEtag()

### setEtag

    public void setEtag(java.lang.String v)

### 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.

### getHandler

    public XmlParser.ElementHandler getHandler(ExtensionProfile p,
                                               java.lang.String namespace,
                                               java.lang.String localName,
                                               org.xml.sax.Attributes attrs)

  Description copied from class: `AbstractExtension`
  The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.

  Specified by:
    `getHandler` in interface `Extension`
  Overrides:
    `getHandler` in class `ExtensionPoint`
  Parameters:
    `p` - extension profile
    `namespace` - extension namespace
    `localName` - tag name, without the namespace prefix
    `attrs` - tag attributes
  Returns:
    an element handler

### generate

    public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                         ExtensionProfile p)
                  throws java.io.IOException

  Description copied from interface: `Extension`
  Generates an XML representation for the extension.

  Specified by:
    `generate` in interface `Extension`
  Overrides:
    `generate` in class `AbstractExtension`
  Parameters:
    `w` - XML writer
    `p` - extension profile
  Throws:
    `java.io.IOException`

### generateAtom

    public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w,
                             ExtensionProfile extProfile)
                      throws java.io.IOException

  Generates XML in the Atom format.

  Parameters:
    `w` - Output writer.
    `extProfile` - Extension profile.
  Throws:
    `java.io.IOException`

### generateRss

    public void generateRss(com.google.gdata.util.common.xml.XmlWriter w)
                     throws java.io.IOException

  Generates XML in the RSS format.

  Parameters:
    `w` - Output writer.
  Throws:
    `java.io.IOException`