public class FeedLink extends AbstractFeedElement
| Modifier and Type | Field and Description |
|---|---|
static String |
REL_ALTERNATE |
static String |
REL_SELF |
| Constructor and Description |
|---|
FeedLink(com.helger.commons.url.ISimpleURL aHref) |
FeedLink(com.helger.commons.url.ISimpleURL aHref,
String sRel) |
FeedLink(String sHref) |
FeedLink(String sHref,
String sRel) |
| Modifier and Type | Method and Description |
|---|---|
com.helger.xml.microdom.IMicroElement |
getAsElement(String sElementName)
Convert this news feed element to an MicroElement with the given element
name.
|
String |
getHref()
The "href" attribute contains the link's IRI. atom:link elements MUST have
an href attribute, whose value MUST be a IRI reference [RFC3987].
|
Locale |
getHrefLang()
The "hreflang" attribute's content describes the language of the resource
pointed to by the href attribute.
|
int |
getLength()
The "length" attribute indicates an advisory length of the linked content
in octets; it is a hint about the content length of the representation
returned when the IRI in the href attribute is mapped to a URI and
dereferenced.
|
String |
getRel()
atom:link elements MAY have a "rel" attribute that indicates the link
relation type.
|
String |
getTitle()
The "title" attribute conveys human-readable information about the link.
|
String |
getType()
On the link element, the "type" attribute's value is an advisory media
type: it is a hint about the type of the representation that is expected to
be returned when the value of the href attribute is dereferenced.
|
boolean |
isValid()
Check if this element matches the specification.
|
void |
setHref(String sHref) |
void |
setHrefLang(Locale aContentLocale) |
void |
setLength(int nLength) |
void |
setRel(String sRel) |
void |
setTitle(String sTitle) |
void |
setType(String sType) |
getLanguage, setLanguage, setLanguagepublic static final String REL_SELF
public static final String REL_ALTERNATE
public FeedLink(@Nonnull com.helger.commons.url.ISimpleURL aHref)
@Nullable public String getHref()
@Nullable public String getRel()
atom:link elements MAY have a "rel" attribute that indicates the link relation type. If the "rel" attribute is not present, the link element MUST be interpreted as if the link relation type is "alternate".
The value of "rel" MUST be a string that is non-empty and matches either the "isegment-nz-nc" or the "IRI" production in [RFC3987]. Note that use of a relative reference other than a simple name is not allowed. If a name is given, implementations MUST consider the link relation type equivalent to the same name registered within the IANA Registry of Link Relations (Section 7), and thus to the IRI that would be obtained by appending the value of the rel attribute to the string "http://www.iana.org/assignments/relation/". The value of "rel" describes the meaning of the link, but does not impose any behavioral requirements on Atom Processors.
This document defines five initial values for the Registry of Link Relations:
<link rel="related" href="http://search.example.com/"/>An identical link might appear as a child of any atom:entry whose content contains a discussion of that same search engine.
@Nullable public String getType()
@Nullable public Locale getHrefLang()
@Nullable public String getTitle()
public void setLength(int nLength)
public int getLength()
@Nonnull public com.helger.xml.microdom.IMicroElement getAsElement(@Nonnull String sElementName)
IFeedElementIFeedElement.isValid() it
should be safe anyway to create an element.sElementName - The element name to use. May neither be null nor empty.IMicroElement and never null.public boolean isValid()
IFeedElementtrue if the element is valid, and false
otherwise.Copyright © 2014–2017 Philip Helger. All rights reserved.