public class StandardTemplateResourceResolver extends java.lang.Object implements TemplateResourceResolver
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}.snippetorg/springframework/restdocs/templates/${templateFormatId}/default-${name}.snippet
TemplateFormat.getId()| Constructor and Description |
|---|
StandardTemplateResourceResolver(TemplateFormat templateFormat)
Creates a new
StandardTemplateResourceResolver that will produce default
template resources formatted with the given templateFormat. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.core.io.Resource |
resolveTemplateResource(java.lang.String name)
Resolves a
Resource for the template with the given name. |
public StandardTemplateResourceResolver(TemplateFormat templateFormat)
StandardTemplateResourceResolver that will produce default
template resources formatted with the given templateFormat.templateFormat - the format for the default snippet templatespublic org.springframework.core.io.Resource resolveTemplateResource(java.lang.String name)
TemplateResourceResolverResource for the template with the given name.resolveTemplateResource in interface TemplateResourceResolvername - the name of the templateResource from which the template can be read