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(java.lang.String snippetName,
java.util.List<ParameterDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedParameters)
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 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(ParameterDescriptor descriptor)
Returns a model for the given
descriptor. |
protected abstract java.util.Set<java.lang.String> |
extractActualParameters(Operation operation)
Extracts the names of the parameters that were present in the given
operation. |
protected java.util.Map<java.lang.String,ParameterDescriptor> |
getParameterDescriptors()
Returns a
Map of ParameterDescriptors that will
be used to generate the documentation key by their
ParameterDescriptor.getName(). |
protected abstract void |
verificationFailed(java.util.Set<java.lang.String> undocumentedParameters,
java.util.Set<java.lang.String> missingParameters)
Called when the documented parameters do not match the actual parameters.
|
document, getAttributes, getSnippetNameprotected AbstractParametersSnippet(java.lang.String snippetName,
java.util.List<ParameterDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedParameters)
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. If ignoreUndocumentedParameters is true,
undocumented parameters will be ignored and will not trigger a failure.snippetName - The snippet namedescriptors - The descriptorsattributes - The additional attributesignoreUndocumentedParameters - whether undocumented parameters 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 abstract java.util.Set<java.lang.String> extractActualParameters(Operation operation)
operation.operation - the operationprotected abstract void verificationFailed(java.util.Set<java.lang.String> undocumentedParameters,
java.util.Set<java.lang.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 java.util.Map<java.lang.String,ParameterDescriptor> getParameterDescriptors()
Map of ParameterDescriptors that will
be used to generate the documentation key by their
ParameterDescriptor.getName().protected java.util.Map<java.lang.String,java.lang.Object> createModelForDescriptor(ParameterDescriptor descriptor)
descriptor.descriptor - the descriptor