Spring Hateoas

org.springframework.hateoas.hal
Class DefaultCurieProvider

java.lang.Object
  extended by org.springframework.hateoas.hal.DefaultCurieProvider
All Implemented Interfaces:
CurieProvider

public class DefaultCurieProvider
extends Object
implements CurieProvider

Default implementation of CurieProvider rendering a single configurable UriTemplate based curie.

Since:
0.9
Author:
Oliver Gierke

Nested Class Summary
protected static class DefaultCurieProvider.Curie
          Value object to get the curie Link rendered in JSON.
 
Constructor Summary
DefaultCurieProvider(String name, UriTemplate uriTemplate)
          Creates a new DefaultCurieProvider for the given name and UriTemplate.
 
Method Summary
 Collection<? extends Object> getCurieInformation(Links links)
          Returns an object to render as the base curie information.
 String getNamespacedRelFrom(Link link)
          Returns the rel to be rendered for the given Link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCurieProvider

public DefaultCurieProvider(String name,
                            UriTemplate uriTemplate)
Creates a new DefaultCurieProvider for the given name and UriTemplate.

Parameters:
name - must not be null or empty.
uriTemplate - must not be null and contain exactly one template variable.
Method Detail

getCurieInformation

public Collection<? extends Object> getCurieInformation(Links links)
Description copied from interface: CurieProvider
Returns an object to render as the base curie information. Implementations have to make sure, the retunred instances renders as defined in the spec.

Specified by:
getCurieInformation in interface CurieProvider
Parameters:
links - the Links that have been added to the response so far.
Returns:
must not be null.

getNamespacedRelFrom

public String getNamespacedRelFrom(Link link)
Description copied from interface: CurieProvider
Returns the rel to be rendered for the given Link. Will potentially prefix the rel but also might decide not to, depending on the actual rel.

Specified by:
getNamespacedRelFrom in interface CurieProvider
Returns:

Spring Hateoas

Copyright © 2012-2014–2014 Pivotal, Inc.. All rights reserved.