public class LinksSnippet extends TemplatedSnippet
Snippet that documents a RESTful resource's links.| Modifier | Constructor and Description |
|---|---|
protected |
LinksSnippet(LinkExtractor linkExtractor,
java.util.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,
java.util.List<LinkDescriptor> descriptors,
boolean ignoreUndocumentedLinks)
Creates a new
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. |
protected |
LinksSnippet(LinkExtractor linkExtractor,
java.util.List<LinkDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. |
protected |
LinksSnippet(LinkExtractor linkExtractor,
java.util.List<LinkDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedLinks)
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 |
|---|---|
LinksSnippet |
and(LinkDescriptor... additionalDescriptors)
Returns a new
LinksSnippet configured with this snippet's link extractor
and attributes, and its descriptors combined with the given
additionalDescriptors. |
LinksSnippet |
and(java.util.List<LinkDescriptor> additionalDescriptors)
Returns a new
LinksSnippet configured with this snippet's link extractor
and attributes, and its descriptors combined with the given
additionalDescriptors. |
protected java.util.Map<java.lang.String,java.lang.Object> |
createModel(Operation operation)
Create the model that should be used during template rendering to document the
given
operation. |
protected java.util.Map<java.lang.String,java.lang.Object> |
createModelForDescriptor(LinkDescriptor descriptor)
Returns a model for the given
descriptor. |
protected java.util.Map<java.lang.String,LinkDescriptor> |
getDescriptorsByRel()
|
document, getAttributes, getSnippetNameprotected LinksSnippet(LinkExtractor linkExtractor, java.util.List<LinkDescriptor> descriptors)
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors.
Undocumented links will trigger a failure.linkExtractor - the link extractordescriptors - the link descriptorsprotected LinksSnippet(LinkExtractor linkExtractor, java.util.List<LinkDescriptor> descriptors, boolean ignoreUndocumentedLinks)
LinksSnippet that will extract links using the given
linkExtractor and document them using the given descriptors. If
ignoreUndocumentedLinks is true, undocumented links will be ignored
and will not trigger a failure.linkExtractor - the link extractordescriptors - the link descriptorsignoreUndocumentedLinks - whether undocumented links should be ignoredprotected LinksSnippet(LinkExtractor linkExtractor, java.util.List<LinkDescriptor> descriptors, java.util.Map<java.lang.String,java.lang.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.
Undocumented links will trigger a failure.linkExtractor - the link extractordescriptors - the link descriptorsattributes - the additional attributesprotected LinksSnippet(LinkExtractor linkExtractor, java.util.List<LinkDescriptor> descriptors, java.util.Map<java.lang.String,java.lang.Object> attributes, boolean ignoreUndocumentedLinks)
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.
If ignoreUndocumentedLinks is true, undocumented links will be
ignored and will not trigger a failure.linkExtractor - the link extractordescriptors - the link descriptorsattributes - the additional attributesignoreUndocumentedLinks - whether undocumented links should be ignoredprotected java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,LinkDescriptor> getDescriptorsByRel()
protected java.util.Map<java.lang.String,java.lang.Object> createModelForDescriptor(LinkDescriptor descriptor)
descriptor.descriptor - the descriptorpublic final LinksSnippet and(LinkDescriptor... additionalDescriptors)
LinksSnippet configured with this snippet's link extractor
and attributes, and its descriptors combined with the given
additionalDescriptors.additionalDescriptors - the additional descriptorspublic final LinksSnippet and(java.util.List<LinkDescriptor> additionalDescriptors)
LinksSnippet configured with this snippet's link extractor
and attributes, and its descriptors combined with the given
additionalDescriptors.additionalDescriptors - the additional descriptors