Class RestDocumentationContextPlaceholderResolver

java.lang.Object
org.springframework.restdocs.snippet.RestDocumentationContextPlaceholderResolver
All Implemented Interfaces:
org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver

public class RestDocumentationContextPlaceholderResolver extends Object implements org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
A PropertyPlaceholderHelper.PlaceholderResolver that resolves placeholders using a RestDocumentationContext. The following placeholders are supported:
Author:
Andy Wilkinson
  • Constructor Details

    • RestDocumentationContextPlaceholderResolver

      public RestDocumentationContextPlaceholderResolver(RestDocumentationContext context)
      Creates a new placeholder resolver that will resolve placeholders using the given context.
      Parameters:
      context - the context to use
  • Method Details

    • resolvePlaceholder

      public String resolvePlaceholder(String placeholderName)
      Specified by:
      resolvePlaceholder in interface org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
    • camelCaseToKebabCase

      protected final String camelCaseToKebabCase(String string)
      Converts the given string from camelCase to kebab-case.
      Parameters:
      string - the string
      Returns:
      the converted string
    • camelCaseToSnakeCase

      protected final String camelCaseToSnakeCase(String string)
      Converts the given string from camelCase to snake_case.
      Parameters:
      string - the string
      Returns:
      the converted string
    • getContext

      protected final RestDocumentationContext getContext()
      Returns the RestDocumentationContext that should be used during placeholder resolution.
      Returns:
      the context