ILink.Rel, ILink.Type
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
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
public Link()
@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)
public static void registerMetadata(MetadataRegistry registry)
public java.lang.String getRel()
self
, prev
, next
, enclosure
, etc.public void setRel(java.lang.String v)
ILink
public java.lang.String getType()
public void setType(java.lang.String v)
ILink
public java.net.URI getHrefUri()
public void setHref(java.lang.String v)
Reference
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.