de.smartics.resteasy.hypermedia.renderer
Class LinkDescriptor

Package class diagram package LinkDescriptor
java.lang.Object
  extended by javax.ws.rs.core.Link
      extended by de.smartics.resteasy.hypermedia.renderer.LinkDescriptor
Direct Known Subclasses:
LinkDescriptorAtom, LinkDescriptorJaxrs

public abstract class LinkDescriptor
     
     
extends javax.ws.rs.core.Link

Provides information on a single link.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.ws.rs.core.Link
javax.ws.rs.core.Link.Builder, javax.ws.rs.core.Link.JaxbAdapter, javax.ws.rs.core.Link.JaxbLink
 
Field Summary
protected  LinkMetadata metadata
          The additional link metadata about the link.
protected  Map<String,String> params
          The path parameters to apply to the template link.
protected  List<String> rels
          The list of tokens that specify the relationship between the document containing the hyperlink and the destination indicated by the hyperlink.
 
Fields inherited from class javax.ws.rs.core.Link
REL, TITLE, TYPE
 
Constructor Summary
protected LinkDescriptor(LinkMetadata metadata, Map<String,String> params, List<String> rels)
          Default constructor.
 
Method Summary
 void addRels(List<String> rels)
          Adds the list of relations.
 void addRels(String... rels)
          Adds the list of relations.
 String getAccessKey()
          Returns the key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.
 String getContextMenu()
          Returns the identifier of a menu with which to associate the element as a context menu.
 String getCssClass()
          Returns the CSS class information to the link.
 String getDir()
          Returns the element’s text directionality.
 String getHelp()
          Returns the detailed help information on the link.
abstract  String getHref()
          Returns the URI to the resource the link points to.
abstract  String getHrefLang()
          Returns the content that describes the language of the resource pointed to by the link.
 String getId()
          Returns the identifier of the link.
 String getLabel()
          Returns the standard label to be rendered as the visible part of the link.
abstract  String getLength()
          Returns the 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 getMedia()
          Returns the media for which the destination of the hyperlink was designed.
 Map<String,String> getParams()
          Returns the path parameters to apply to the template link.
 String getRel()
          Returns the relation attribute of the link.
 List<String> getRels()
          Returns the relations of this link.
 String getShortLabel()
          Returns the short version of the label to be rendered in confined space.
 Integer getTabIndex()
          Returns the tab index.
 String getTarget()
          Returns the name or keyword giving a browsing context for UAs to use when following the hyperlink.
 String getTitle()
          Returns the advisory information associated with the element.
abstract  String getType()
          Returns the media type of the resource the link points to.
 URI getUri()
           
 javax.ws.rs.core.UriBuilder getUriBuilder()
           
 Boolean isHidden()
          Returns the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.
 void putParam(String name, String value)
          Adds the given parameter to the map of parameters.
 void setAccessKey(String accessKey)
          Sets the key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.
 void setContextMenu(String contextMenu)
          Sets the identifier of a menu with which to associate the element as a context menu.
 void setCssClass(String cssClass)
          Sets the CSS class information to the link.
 void setDir(String dir)
          Sets the element’s text directionality.
 void setHelp(String help)
          Sets the detailed help information on the link.
 void setHidden(Boolean hidden)
          Sets the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.
abstract  void setHref(String href)
          Sets the URI to the resource the link points to.
abstract  void setHrefLang(String hrefLang)
          Sets the content that describes the language of the resource pointed to by the link.
 void setId(String id)
          Sets the identifier of the link.
 void setLabel(String label)
          Sets the standard label to be rendered as the visible part of the link.
abstract  void setLength(String length)
          Sets the 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.
 void setMedia(String media)
          Sets the media for which the destination of the hyperlink was designed.
 void setShortLabel(String shortLabel)
          Sets the short version of the label to be rendered in confined space.
 void setTabIndex(Integer tabIndex)
          Sets the tab index.
 void setTarget(String target)
          Sets the name or keyword giving a browsing context for UAs to use when following the hyperlink.
 void setTitle(String title)
          Sets the advisory information associated with the element.
abstract  void setType(String type)
          Sets the media type of the resource the link points to.
protected static List<String> splitRel(String rel)
          Splits the whitespace separated relation link attribute into its parts.
 String toString()
           
 
Methods inherited from class javax.ws.rs.core.Link
fromLink, fromMethod, fromPath, fromResource, fromUri, fromUri, fromUriBuilder, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

metadata

protected final LinkMetadata metadata
The additional link metadata about the link.


params

protected final Map<String,String> params
The path parameters to apply to the template link.


rels

protected final List<String> rels
The list of tokens that specify the relationship between the document containing the hyperlink and the destination indicated by the hyperlink.

See Also:
rel
Constructor Detail

LinkDescriptor

protected LinkDescriptor(LinkMetadata metadata,
                         Map<String,String> params,
                         List<String> rels)
Default constructor.

Parameters:
metadata - the additional link metadata about the link.
params - the value for params.
rels - the relations of this link.
Method Detail

splitRel

protected static final List<String> splitRel(String rel)
Splits the whitespace separated relation link attribute into its parts.

Parameters:
rel - the whitespace separated relation link attribute.
Returns:
the individual parts.

getUri

public URI getUri()
Specified by:
getUri in class javax.ws.rs.core.Link

getUriBuilder

public javax.ws.rs.core.UriBuilder getUriBuilder()
Specified by:
getUriBuilder in class javax.ws.rs.core.Link

getHref

public abstract String getHref()
Returns the URI to the resource the link points to.

Returns:
the URI to the resource the link points to.

setHref

public abstract void setHref(String href)
Sets the URI to the resource the link points to.

Parameters:
href - the URI to the resource the link points to.

getHrefLang

public abstract String getHrefLang()
Returns the content that describes the language of the resource pointed to by the link. When used together with the rel="alternate", it implies a translated version of the entry. Link elements MAY have an hreflang attribute, whose value MUST be a language tag [RFC3066].

Returns:
the content that describes the language of the resource pointed to by the link.

setHrefLang

public abstract void setHrefLang(String hrefLang)
Sets the content that describes the language of the resource pointed to by the link. When used together with the rel="alternate", it implies a translated version of the entry. Link elements MAY have an hreflang attribute, whose value MUST be a language tag [RFC3066].

Parameters:
hrefLang - the content that describes the language of the resource pointed to by the link.

getType

public abstract String getType()
Returns the media type of the resource the link points to.

Specified by:
getType in class javax.ws.rs.core.Link
Returns:
the media type of the resource the link points to.

setType

public abstract void setType(String type)
Sets the media type of the resource the link points to.

Parameters:
type - the media type of the resource the link points to.

getLength

public abstract String getLength()
Returns the 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. Note that the length attribute does not override the actual content length of the representation as reported by the underlying protocol. Link elements MAY have a length attribute.

Returns:
the advisory length of the linked content in octets.

setLength

public abstract void setLength(String length)
Sets the 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. Note that the length attribute does not override the actual content length of the representation as reported by the underlying protocol. Link elements MAY have a length attribute.

Parameters:
length - the advisory length of the linked content in octets.

getRels

public List<String> getRels()
Returns the relations of this link.

Specified by:
getRels in class javax.ws.rs.core.Link
Returns:
the relations of this link.

addRels

public void addRels(String... rels)
             throws NullPointerException
Adds the list of relations.

Parameters:
rels - the relations to add.
Throws:
NullPointerException - if rels is null.

addRels

public void addRels(List<String> rels)
             throws NullPointerException
Adds the list of relations.

Parameters:
rels - the relations to add.
Throws:
NullPointerException - if rels is null.

getRel

public String getRel()
Returns the relation attribute of the link. The relations are separated by whitespaces.

Specified by:
getRel in class javax.ws.rs.core.Link
Returns:
the whitespace separated relations of the link.

getParams

public Map<String,String> getParams()
Returns the path parameters to apply to the template link.

Specified by:
getParams in class javax.ws.rs.core.Link
Returns:
the path parameters.

putParam

public void putParam(String name,
                     String value)
              throws NullPointerException,
                     IllegalArgumentException
Adds the given parameter to the map of parameters.

Parameters:
name - the name of the parameter to add.
value - the value to the parameter to add.
Throws:
NullPointerException - if name or value is null.
IllegalArgumentException - if name is blank}.

getAccessKey

public final String getAccessKey()
Returns the key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.

An ordered set of unique space-separated tokens, each of which must be exactly one Unicode code point in length.

See Also:
global attributes
Returns:
the key label or list of key labels with which to associate the element.

setAccessKey

public final void setAccessKey(String accessKey)
Sets the key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.

An ordered set of unique space-separated tokens, each of which must be exactly one Unicode code point in length.

Parameters:
accessKey - the key label or list of key labels with which to associate the element.
See Also:
global attributes

getTabIndex

public final Integer getTabIndex()
Returns the tab index.

Specifies whether the element represents an element that is is focusable (that is, an element which is part of the sequence of focusable elements in the document), and the relative order of the element in the sequence of focusable elements in the document.

See Also:
global attributes
Returns:
the tab index.

setTabIndex

public final void setTabIndex(Integer tabIndex)
Sets the tab index.

Specifies whether the element represents an element that is is focusable (that is, an element which is part of the sequence of focusable elements in the document), and the relative order of the element in the sequence of focusable elements in the document.

Parameters:
tabIndex - the tab index.
See Also:
global attributes

setTitle

public final void setTitle(String title)
Sets the advisory information associated with the element.

Parameters:
title - the advisory information associated with the element.
See Also:
global attributes

getDir

public final String getDir()
Returns the element’s text directionality.

See Also:
global attributes
Returns:
the element’s text directionality.

setDir

public final void setDir(String dir)
Sets the element’s text directionality.

Parameters:
dir - the element’s text directionality.
See Also:
global attributes

isHidden

public final Boolean isHidden()
Returns the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.

See Also:
global attributes
Returns:
the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.

setHidden

public void setHidden(Boolean hidden)
Sets the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.

Parameters:
hidden - the hidden flag to specify that the element represents an element that is not yet, or is no longer, relevant.
See Also:
global attributes

getLabel

public String getLabel()
Returns the standard label to be rendered as the visible part of the link.

Returns:
the standard label to be rendered as the visible part of the link.

setLabel

public final void setLabel(String label)
Sets the standard label to be rendered as the visible part of the link.

Parameters:
label - the standard label to be rendered as the visible part of the link.

getShortLabel

public final String getShortLabel()
Returns the short version of the label to be rendered in confined space.

Returns:
the short version of the label to be rendered in confined space.

setShortLabel

public final void setShortLabel(String shortLabel)
Sets the short version of the label to be rendered in confined space.

Parameters:
shortLabel - the short version of the label to be rendered in confined space.

getHelp

public final String getHelp()
Returns the detailed help information on the link.

Returns:
the detailed help information on the link.

setHelp

public final void setHelp(String help)
Sets the detailed help information on the link.

Parameters:
help - the detailed help information on the link.

getCssClass

public final String getCssClass()
Returns the CSS class information to the link.

Returns:
the CSS class information to the link.

setCssClass

public final void setCssClass(String cssClass)
Sets the CSS class information to the link.

Parameters:
cssClass - the CSS class information to the link.

getId

public String getId()
Returns the identifier of the link.

Returns:
the identifier of the link.

setId

public void setId(String id)
Sets the identifier of the link.

Parameters:
id - the identifier of the link.

getTitle

public String getTitle()
Returns the advisory information associated with the element.

Specified by:
getTitle in class javax.ws.rs.core.Link
Returns:
the advisory information associated with the element.

getTarget

public String getTarget()
Returns the name or keyword giving a browsing context for UAs to use when following the hyperlink.

Returns:
the name or keyword giving a browsing context for UAs to use when following the hyperlink.

setTarget

public void setTarget(String target)
Sets the name or keyword giving a browsing context for UAs to use when following the hyperlink.

Parameters:
target - the name or keyword giving a browsing context for UAs to use when following the hyperlink.

getMedia

public String getMedia()
Returns the media for which the destination of the hyperlink was designed.

Values are according to Media Queries.

Returns:
the media for which the destination of the hyperlink was designed.

setMedia

public void setMedia(String media)
Sets the media for which the destination of the hyperlink was designed.

Values are according to Media Queries.

Parameters:
media - the media for which the destination of the hyperlink was designed.

getContextMenu

public String getContextMenu()
Returns the identifier of a menu with which to associate the element as a context menu.

Returns:
the identifier of a menu with which to associate the element as a context menu.

setContextMenu

public void setContextMenu(String contextMenu)
Sets the identifier of a menu with which to associate the element as a context menu.

Parameters:
contextMenu - the identifier of a menu with which to associate the element as a context menu.

toString

public String toString()
Specified by:
toString in class javax.ws.rs.core.Link


Copyright © 2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.