public final class StandardWriterResolver extends java.lang.Object implements WriterResolver
WriterResolver
.Constructor and Description |
---|
StandardWriterResolver(PlaceholderResolverFactory placeholderResolverFactory,
java.lang.String encoding,
TemplateFormat templateFormat)
Creates a new
StandardWriterResolver that will use a
PropertyPlaceholderHelper.PlaceholderResolver created from the given
placeholderResolverFactory to resolve any placeholders in the
operationName . |
StandardWriterResolver(org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver)
Deprecated.
since 1.1.0 in favor of
StandardWriterResolver(PlaceholderResolverFactory, String, TemplateFormat) |
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
resolve(java.lang.String operationName,
java.lang.String snippetName,
RestDocumentationContext context)
Returns a writer that can be used to write the snippet with the given name for the
operation with the given name.
|
void |
setEncoding(java.lang.String encoding)
Deprecated.
|
@Deprecated public StandardWriterResolver(org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver)
StandardWriterResolver(PlaceholderResolverFactory, String, TemplateFormat)
StandardWriterResolver
that will use the given
placeholderResolver
to resolve any placeholders in the
operationName
. Writers will use UTF-8
encoding and, when writing to
a file, will use a filename appropriate for Asciidoctor content.placeholderResolver
- the placeholder resolverpublic StandardWriterResolver(PlaceholderResolverFactory placeholderResolverFactory, java.lang.String encoding, TemplateFormat templateFormat)
StandardWriterResolver
that will use a
PropertyPlaceholderHelper.PlaceholderResolver
created from the given
placeholderResolverFactory
to resolve any placeholders in the
operationName
. Writers will use the given encoding
and, when
writing to a file, will use a filename appropriate for content generated from
templates in the given templateFormat
.placeholderResolverFactory
- the placeholder resolver factoryencoding
- the encodingtemplateFormat
- the snippet formatpublic java.io.Writer resolve(java.lang.String operationName, java.lang.String snippetName, RestDocumentationContext context) throws java.io.IOException
WriterResolver
resolve
in interface WriterResolver
operationName
- the name of the operation that is being documentedsnippetName
- the name of the snippetcontext
- the current documentation contextjava.io.IOException
- if a writer cannot be resolved@Deprecated public void setEncoding(java.lang.String encoding)
WriterResolver
setEncoding
in interface WriterResolver
encoding
- the encoding