|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.hateoas.mvc.ResourceAssemblerSupport<T,D>
public abstract class ResourceAssemblerSupport<T,D extends ResourceSupport>
Base class to implement ResourceAssemblers. Will automate ResourceSupport instance creation and make
sure a self-link is always added.
| Constructor Summary | |
|---|---|
ResourceAssemblerSupport(Class<?> controllerClass,
Class<D> resourceType)
Creates a new ResourceAssemblerSupport using the given controller class and resource type. |
|
| Method Summary | |
|---|---|
protected D |
createResourceWithId(Object id,
T entity)
Creates a new resource with a self link to the given id. |
protected D |
createResourceWithId(Object id,
T entity,
Object... parameters)
|
protected D |
instantiateResource(T entity)
Instantiates the resource object. |
List<D> |
toResources(Iterable<? extends T> entities)
Converts all given entities into resources. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.hateoas.ResourceAssembler |
|---|
toResource |
| Constructor Detail |
|---|
public ResourceAssemblerSupport(Class<?> controllerClass,
Class<D> resourceType)
ResourceAssemblerSupport using the given controller class and resource type.
controllerClass - must not be null.resourceType - must not be null.| Method Detail |
|---|
public List<D> toResources(Iterable<? extends T> entities)
entities - must not be null.
ResourceAssembler.toResource(Object)
protected D createResourceWithId(Object id,
T entity)
entity - must not be null.id - must not be null.
protected D createResourceWithId(Object id,
T entity,
Object... parameters)
protected D instantiateResource(T entity)
entity -
|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||