Spring Hateoas

org.springframework.hateoas.jaxrs
Class JaxRsLinkBuilder

java.lang.Object
  extended by org.springframework.hateoas.core.LinkBuilderSupport<JaxRsLinkBuilder>
      extended by org.springframework.hateoas.jaxrs.JaxRsLinkBuilder
All Implemented Interfaces:
LinkBuilder

public class JaxRsLinkBuilder
extends LinkBuilderSupport<JaxRsLinkBuilder>

LinkBuilder to derive URI mappings from a JAX-RS Path annotation.

Author:
Oliver Gierke, Kamill Sokol

Method Summary
protected  JaxRsLinkBuilder createNewInstance(UriComponentsBuilder builder)
          Creates a new instance of the sub-class.
protected  JaxRsLinkBuilder getThis()
          Returns the current concrete instance.
static JaxRsLinkBuilder linkTo(Class<?> service)
          Creates a JaxRsLinkBuilder instance to link to the Path mapping tied to the given class.
static JaxRsLinkBuilder linkTo(Class<?> service, Object... parameters)
          Creates a new JaxRsLinkBuilder instance to link to the Path mapping tied to the given class binding the given parameters to the URI template.
 
Methods inherited from class org.springframework.hateoas.core.LinkBuilderSupport
slash, slash, toString, toUri, withRel, withSelfRel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

linkTo

public static JaxRsLinkBuilder linkTo(Class<?> service)
Creates a JaxRsLinkBuilder instance to link to the Path mapping tied to the given class.

Parameters:
service - the class to discover the annotation on, must not be null.
Returns:

linkTo

public static JaxRsLinkBuilder linkTo(Class<?> service,
                                      Object... parameters)
Creates a new JaxRsLinkBuilder instance to link to the Path mapping tied to the given class binding the given parameters to the URI template.

Parameters:
service - the class to discover the annotation on, must not be null.
parameters - additional parameters to bind to the URI template declared in the annotation, must not be null.
Returns:

getThis

protected JaxRsLinkBuilder getThis()
Description copied from class: LinkBuilderSupport
Returns the current concrete instance.

Specified by:
getThis in class LinkBuilderSupport<JaxRsLinkBuilder>
Returns:

createNewInstance

protected JaxRsLinkBuilder createNewInstance(UriComponentsBuilder builder)
Description copied from class: LinkBuilderSupport
Creates a new instance of the sub-class.

Specified by:
createNewInstance in class LinkBuilderSupport<JaxRsLinkBuilder>
Parameters:
builder - will never be null.
Returns:

Spring Hateoas

Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.