Class StandardWriterResolver

All Implemented Interfaces:

public final class StandardWriterResolver extends Object implements WriterResolver
Standard implementation of WriterResolver.
Andy Wilkinson
  • Constructor Details

    • StandardWriterResolver

      public StandardWriterResolver(PlaceholderResolverFactory placeholderResolverFactory, 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. 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 factory
      encoding - the encoding
      templateFormat - the snippet format
  • Method Details

    • resolve

      public Writer resolve(String operationName, String snippetName, RestDocumentationContext context) throws IOException
      Description copied from interface: WriterResolver
      Returns a writer that can be used to write the snippet with the given name for the operation with the given name.
      Specified by:
      resolve in interface WriterResolver
      operationName - the name of the operation that is being documented
      snippetName - the name of the snippet
      context - the current documentation context
      the writer
      IOException - if a writer cannot be resolved