public abstract class AbstractHeadersSnippet extends TemplatedSnippet
TemplatedSnippet subclass that provides a base for snippets that
document a RESTful resource's request or response headers.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractHeadersSnippet(String type,
List<HeaderDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
AbstractHeadersSnippet that will produce a snippet named
<type>-headers. |
| 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(HeaderDescriptor descriptor)
Returns a model for the given
descriptor. |
protected abstract Set<String> |
extractActualHeaders(Operation operation)
Extracts the names of the headers from the request or response of the given
operation. |
protected List<HeaderDescriptor> |
findMissingHeaders(Operation operation)
Finds the headers that are missing from the operation.
|
protected List<HeaderDescriptor> |
getHeaderDescriptors()
Returns the list of
HeaderDescriptors that will be used to
generate the documentation. |
document, getAttributes, getSnippetNameprotected AbstractHeadersSnippet(String type, List<HeaderDescriptor> descriptors, Map<String,Object> attributes)
AbstractHeadersSnippet that will produce a snippet named
<type>-headers. The headers will be documented using the given
descriptors and the given attributes will be included in the model
during template rendering.type - the type of the headersdescriptors - the header 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 List<HeaderDescriptor> findMissingHeaders(Operation operation)
headerDescriptors but is not present in the
operation.operation - the operationprotected abstract Set<String> extractActualHeaders(Operation operation)
operation.operation - the operationprotected final List<HeaderDescriptor> getHeaderDescriptors()
HeaderDescriptors that will be used to
generate the documentation.protected Map<String,Object> createModelForDescriptor(HeaderDescriptor descriptor)
descriptor.descriptor - the descriptor