Class StandardTemplateResourceResolver
java.lang.Object
org.springframework.restdocs.templates.StandardTemplateResourceResolver
- All Implemented Interfaces:
TemplateResourceResolver
Standard implementation of
TemplateResourceResolver.
Templates are resolved by looking for resources on the classpath. The following locations are checked in order:
-
org/springframework/restdocs/templates/${templateFormatId}/${name}.snippet org/springframework/restdocs/templates/${name}.snippet-
org/springframework/restdocs/templates/${templateFormatId}/default-${name}.snippet
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStandardTemplateResourceResolver(TemplateFormat templateFormat) Creates a newStandardTemplateResourceResolverthat will produce default template resources formatted with the giventemplateFormat. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.ResourceResolves aResourcefor the template with the givenname.
-
Constructor Details
-
StandardTemplateResourceResolver
Creates a newStandardTemplateResourceResolverthat will produce default template resources formatted with the giventemplateFormat.- Parameters:
templateFormat- the format for the default snippet templates
-
-
Method Details
-
resolveTemplateResource
Description copied from interface:TemplateResourceResolverResolves aResourcefor the template with the givenname.- Specified by:
resolveTemplateResourcein interfaceTemplateResourceResolver- Parameters:
name- the name of the template- Returns:
- the
Resourcefrom which the template can be read
-