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
ConstructorDescriptionStandardTemplateResourceResolver
(TemplateFormat templateFormat) Creates a newStandardTemplateResourceResolver
that will produce default template resources formatted with the giventemplateFormat
. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.Resource
Resolves aResource
for the template with the givenname
.
-
Constructor Details
-
StandardTemplateResourceResolver
Creates a newStandardTemplateResourceResolver
that 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:TemplateResourceResolver
Resolves aResource
for the template with the givenname
.- Specified by:
resolveTemplateResource
in interfaceTemplateResourceResolver
- Parameters:
name
- the name of the template- Returns:
- the
Resource
from which the template can be read
-