|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gdata.model.Element
com.google.gdata.model.atom.Link
public class Link
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. |
protected long |
length
Length of the resource pointed to by href, in bytes. |
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. |
protected |
Link(ElementKey<?,? extends Link> key)
Constructs a new instance using the specified element metadata. |
protected |
Link(ElementKey<?,? extends Link> key,
Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance. |
|
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. |
protected Element |
narrow(ElementMetadata<?,?> meta,
ValidationContext vc)
Narrow down element's type to the most specific one possible. |
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 java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ElementKey<java.lang.Void,Link> KEY
public static final AttributeKey<java.lang.String> HREF
public static final AttributeKey<java.lang.String> REL
public static final AttributeKey<java.lang.String> TYPE
public static final AttributeKey<java.lang.String> HREFLANG
public static final AttributeKey<java.lang.String> TITLE
public static final AttributeKey<java.lang.String> XML_LANG
public static final AttributeKey<java.lang.Long> LENGTH
public static final AttributeKey<java.lang.String> ETAG
protected long length
| Constructor Detail |
|---|
public Link()
protected Link(ElementKey<?,? extends Link> key)
key - the element key for this link.
protected Link(ElementKey<?,? extends Link> key,
Element source)
Element instance. Will use the given ElementMetadata as the
metadata for the element.
key - the element key to use for this element.source - source element
@Deprecated
public Link(java.lang.String rel,
java.lang.String type,
java.lang.String href)
Link(String, String, URI) instead.
public Link(java.lang.String rel,
java.lang.String type,
java.net.URI href)
| Method Detail |
|---|
public static void registerMetadata(MetadataRegistry registry)
public java.lang.String getRel()
self, prev, next, enclosure, etc.
getRel in interface ILinkILink.Relpublic void setRel(java.lang.String v)
ILink
setRel in interface ILinkpublic java.lang.String getType()
getType in interface ILinkpublic void setType(java.lang.String v)
ILink
setType in interface ILinkpublic java.lang.String getHref()
getHref in interface Referencepublic java.net.URI getHrefUri()
public void setHref(java.lang.String v)
Reference
setHref in interface Referencev - the resource href.public void setHref(java.net.URI v)
public java.lang.String getHrefLang()
public void setHrefLang(java.lang.String v)
public java.lang.String getTitle()
public void setTitle(java.lang.String v)
public java.lang.String getTitleLang()
public void setTitleLang(java.lang.String v)
public long getLength()
public void setLength(long v)
public java.lang.String getEtag()
null if unknown.
public void setEtag(java.lang.String v)
public Content getContent()
null if no content has been set.
This is used to inline an atom:content element inside an atom:link element.
public void setContent(Content c)
c - the content to place inside the link.
public boolean matches(java.lang.String relToMatch,
java.lang.String typeToMatch)
rel and type
values.
relToMatch - rel value to match or null to match any
rel value.typeToMatch - type value to match or null to match any
type value.
protected Element narrow(ElementMetadata<?,?> meta,
ValidationContext vc)
ElementAny validation errors discovered during narrowing are accumulated in the validation context.
Default action is to not do anything with current element. Subclasses may override this function to narrow the type in some custom fashion.
narrow in class Elementmeta - the element metadata to narrow to.vc - validation context
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||