public abstract class AbstractParametersSnippet extends TemplatedSnippet
TemplatedSnippet subclass that provides a base for snippets that
document parameters from a request sent to a RESTful resource.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractParametersSnippet(String snippetName,
List<ParameterDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
AbstractParametersSnippet that will produce a snippet with
the given snippetName that will document parameters 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(ParameterDescriptor descriptor)
Returns a model for the given
descriptor. |
protected abstract Set<String> |
extractActualParameters(Operation operation)
Extracts the names of the parameters that were present in the given
operation. |
protected Map<String,ParameterDescriptor> |
getFieldDescriptors()
Returns a
Map of ParameterDescriptors that will
be used to generate the documentation key by their
ParameterDescriptor.getName(). |
protected abstract void |
verificationFailed(Set<String> undocumentedParameters,
Set<String> missingParameters)
Called when the documented parameters do not match the actual parameters.
|
document, getAttributes, getSnippetNameprotected AbstractParametersSnippet(String snippetName, List<ParameterDescriptor> descriptors, Map<String,Object> attributes)
AbstractParametersSnippet that will produce a snippet with
the given snippetName that will document parameters using the given
descriptors. The given attributes will be included in the model
during template rendering.snippetName - The snippet namedescriptors - The 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 abstract Set<String> extractActualParameters(Operation operation)
operation.operation - the operationprotected abstract void verificationFailed(Set<String> undocumentedParameters, Set<String> missingParameters)
undocumentedParameters - the parameters that were found in the operation but
were not documentedmissingParameters - the parameters that were documented but were not found in
the operationprotected final Map<String,ParameterDescriptor> getFieldDescriptors()
Map of ParameterDescriptors that will
be used to generate the documentation key by their
ParameterDescriptor.getName().protected Map<String,Object> createModelForDescriptor(ParameterDescriptor descriptor)
descriptor.descriptor - the descriptor