public abstract class TemplatedSnippet extends java.lang.Object implements Snippet
| Modifier | Constructor and Description |
|---|---|
protected |
TemplatedSnippet(java.lang.String snippetName,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
TemplatedSnippet that will produce a snippet with the given
snippetName. |
protected |
TemplatedSnippet(java.lang.String snippetName,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
TemplatedSnippet that will produce a snippet with the given
snippetName using a template with the given templateName. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract 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. |
void |
document(Operation operation)
Documents the call to the RESTful API described by the given
operation. |
protected java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the additional attributes that will be included in the model during
template rendering.
|
protected java.lang.String |
getSnippetName()
Returns the name of the snippet that will be created.
|
protected TemplatedSnippet(java.lang.String snippetName,
java.util.Map<java.lang.String,java.lang.Object> attributes)
TemplatedSnippet that will produce a snippet with the given
snippetName. The snippetName will also be used as the name of the
template. The given attributes will be included in the model during
rendering of the template.snippetName - The name of the snippetattributes - The additional attributesTemplatedSnippet(String, String, Map)protected TemplatedSnippet(java.lang.String snippetName,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.Object> attributes)
TemplatedSnippet that will produce a snippet with the given
snippetName using a template with the given templateName. The given
attributes will be included in the model during rendering of the template.snippetName - The name of the snippettemplateName - The name of the templateattributes - The additional attributespublic void document(Operation operation) throws java.io.IOException
Snippetoperation.protected abstract java.util.Map<java.lang.String,java.lang.Object> createModel(Operation operation)
operation. Any additional attributes that were supplied when this
TemplatedSnippet were created will be automatically added to the model
prior to rendering.operation - The operationModelCreationException - if model creation failsprotected final java.util.Map<java.lang.String,java.lang.Object> getAttributes()
protected final java.lang.String getSnippetName()