public class LinksSnippet extends TemplatedSnippet
Snippet that documents a RESTful resource's links.| Modifier | Constructor and Description |
|---|---|
protected |
LinksSnippet(LinkExtractor linkExtractor,
List<LinkDescriptor> descriptors)
Creates a new
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. |
protected |
LinksSnippet(LinkExtractor linkExtractor,
List<LinkDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
createModel(Operation operation)
Create the model that should be used during template rendering to document the
given
operation. |
protected Map<String,Object> |
createModelForDescriptor(LinkDescriptor descriptor)
Returns a model for the given
descriptor |
protected Map<String,LinkDescriptor> |
getDescriptorsByRel()
|
document, getAttributes, getSnippetNameprotected LinksSnippet(LinkExtractor linkExtractor, List<LinkDescriptor> descriptors)
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors.linkExtractor - the link extractordescriptors - the link descriptorsprotected LinksSnippet(LinkExtractor linkExtractor, List<LinkDescriptor> descriptors, Map<String,Object> attributes)
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. The
given attributes will be included in the model during template rendering.linkExtractor - the link extractordescriptors - the link descriptorsattributes - the additional attributesprotected Map<String,Object> createModel(Operation operation)
TemplatedSnippetoperation. Any additional attributes that were supplied when this
TemplatedSnippet were created will be automatically added to the model
prior to rendering.createModel in class TemplatedSnippetoperation - The operationprotected final Map<String,LinkDescriptor> getDescriptorsByRel()
protected Map<String,Object> createModelForDescriptor(LinkDescriptor descriptor)
descriptordescriptor - the descriptor