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) |
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) |
protected void |
verifyParameterDescriptors(Operation operation) |
document, getAttributes, getSnippetName
protected 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)
TemplatedSnippet
operation
. Any additional attributes that were supplied when this
TemplatedSnippet
were created will be automatically added to the model
prior to rendering.createModel
in class TemplatedSnippet
operation
- The operationprotected void verifyParameterDescriptors(Operation operation)
protected abstract void verificationFailed(Set<String> undocumentedParameters, Set<String> missingParameters)
protected 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