public class

Link

extends ExtensionPoint
implements ILink
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.Link
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

External link type.

Summary

Nested Classes
class Link.AtomHandler <atom:link> parser. 
Fields
protected Content content Nested atom:content element or null if no inlined link content.
protected String etag Etag of linked resource, or null if unknown
protected String href Link URI.
protected String hrefLang Language of resource pointed to by href.
protected long length Length of the resource pointed to by href, in bytes.
protected String rel Link relation type.
protected String title Link title.
protected String titleLang Language of link title.
protected String type MIME type of the link target.
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Link()
Link(String rel, String type, String href)
Public Methods
void generate(XmlWriter w, ExtensionProfile p)
Generates an XML representation for the extension.
void generateAtom(XmlWriter w, ExtensionProfile extProfile)
Generates XML in the Atom format.
void generateRss(XmlWriter w)
Generates XML in the RSS format.
Content getContent()
String getEtag()
XmlParser.ElementHandler getHandler(ExtensionProfile p, String namespace, String localName, Attributes attrs)
The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.
String getHref()
Returns the value of the resource reference.
String getHrefLang()
long getLength()
String getRel()
Returns the link relation type.
String getTitle()
String getTitleLang()
String getType()
Returns the mime type of the link.
boolean matches(String relToMatch, String typeToMatch)
Returns whether this link matches the given rel and type values.
void setContent(Content c)
void setEtag(String v)
void setHref(String v)
Sets the value of the resource reference.
void setHrefLang(String v)
void setLength(long v)
void setRel(String v)
Sets the link relation type.
void setTitle(String v)
void setTitleLang(String v)
void setType(String v)
Sets the mime type of the link.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.ILink
From interface com.google.gdata.data.Reference

Fields

protected Content content

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

protected String etag

Etag of linked resource, or null if unknown

protected String href

Link URI.

protected String hrefLang

Language of resource pointed to by href.

protected long length

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

protected String rel

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

protected String title

Link title.

protected String titleLang

Language of link title.

protected String type

MIME type of the link target.

Public Constructors

public Link ()

public Link (String rel, String type, String href)

Parameters
rel
type
href

Public Methods

public void generate (XmlWriter w, ExtensionProfile p)

Generates an XML representation for the extension.

Parameters
w XML writer
p Extension profile
Throws
IOException

public void generateAtom (XmlWriter w, ExtensionProfile extProfile)

Generates XML in the Atom format.

Parameters
w Output writer.
extProfile Extension profile.
Throws
IOException

public void generateRss (XmlWriter w)

Generates XML in the RSS format.

Parameters
w Output writer.
Throws
IOException

public Content getContent ()

public String getEtag ()

public XmlParser.ElementHandler getHandler (ExtensionProfile p, String namespace, String localName, Attributes attrs)

The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.

Parameters
p Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • an element handler

public String getHref ()

Returns the value of the resource reference.

public String getHrefLang ()

public long getLength ()

public String getRel ()

Returns the link relation type. Common values are defined in the ILink.Rel class.

public String getTitle ()

public String getTitleLang ()

public String getType ()

Returns the mime type of the link.

public boolean matches (String relToMatch, 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.

public void setContent (Content c)

Parameters
c

public void setEtag (String v)

Parameters
v

public void setHref (String v)

Sets the value of the resource reference.

Parameters
v The resource href.

public void setHrefLang (String v)

Parameters
v

public void setLength (long v)

Parameters
v

public void setRel (String v)

Sets the link relation type.

Parameters
v

public void setTitle (String v)

Parameters
v

public void setTitleLang (String v)

Parameters
v

public void setType (String v)

Sets the mime type of the link.

Parameters
v