PARENT
- The type of the configurer's parentTYPE
- The concrete type of the configurer to be returned from chained methodspublic abstract class SnippetConfigurer<PARENT,TYPE> extends AbstractNestedConfigurer<PARENT>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SNIPPET_ENCODING
The default encoding for documentation snippets.
|
static TemplateFormat |
DEFAULT_TEMPLATE_FORMAT
The default format for documentation snippets.
|
Modifier | Constructor and Description |
---|---|
protected |
SnippetConfigurer(PARENT parent)
Creates a new
SnippetConfigurer with the given parent . |
Modifier and Type | Method and Description |
---|---|
void |
apply(Map<String,Object> configuration,
RestDocumentationContext context)
Applies the configurer to the given
configuration . |
TYPE |
withAdditionalDefaults(Snippet... additionalDefaultSnippets)
Configures additional documentation snippets that will be produced by default.
|
TYPE |
withDefaults(Snippet... defaultSnippets)
Configures the documentation snippets that will be produced by default.
|
TYPE |
withEncoding(String encoding)
Configures any documentation snippets to be written using the given
encoding . |
TYPE |
withTemplateFormat(TemplateFormat format)
Configures the format of the documentation snippet templates.
|
and
public static final String DEFAULT_SNIPPET_ENCODING
withEncoding(String)
,
Constant Field Valuespublic static final TemplateFormat DEFAULT_TEMPLATE_FORMAT
withTemplateFormat(TemplateFormat)
protected SnippetConfigurer(PARENT parent)
SnippetConfigurer
with the given parent
.parent
- the parentpublic void apply(Map<String,Object> configuration, RestDocumentationContext context)
AbstractConfigurer
configuration
.apply
in class AbstractConfigurer
configuration
- the configuration to be configuredcontext
- the current documentation contextpublic TYPE withEncoding(String encoding)
encoding
. The default is UTF-8.encoding
- the encodingthis
public TYPE withDefaults(Snippet... defaultSnippets)
defaultSnippets
- the default snippetsthis
withAdditionalDefaults(Snippet...)
public TYPE withAdditionalDefaults(Snippet... additionalDefaultSnippets)
additionalDefaultSnippets
- the additional default snippetsthis
withDefaults(Snippet...)
public TYPE withTemplateFormat(TemplateFormat format)
format
- the snippet template formatthis