public Representation toRepresentation(Object source, Variant target,
UniformResource resource) throws IOException {
if (source instanceof Template) {
return new TemplateRepresentation((Template) source,
new ResolverHashModel(Resolver.createResolver(
resource.getRequest(), resource.getResponse())),
target.getMediaType());
}