grails.plugin.json.view.template.JsonViewTemplate.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of views-json Show documentation
Show all versions of views-json Show documentation
Provides additional view technologies to the Grails framework, including JSON and Markup views.
The newest version!
package grails.plugin.json.view.template
import grails.plugin.json.builder.JsonGenerator
import grails.plugin.json.view.JsonViewWritableScript
import grails.plugin.json.view.api.jsonapi.JsonApiIdRenderStrategy
import grails.views.GrailsViewTemplate
import groovy.transform.CompileStatic
import groovy.transform.InheritConstructors
@CompileStatic
@InheritConstructors
class JsonViewTemplate extends GrailsViewTemplate {
JsonGenerator generator
JsonApiIdRenderStrategy jsonApiIdRenderStrategy
@Override
Writable make(Map binding) {
JsonViewWritableScript writableTemplate = (JsonViewWritableScript)super.make(binding)
writableTemplate.setGenerator(generator)
writableTemplate.setJsonApiIdRenderStrategy(jsonApiIdRenderStrategy)
writableTemplate
}
}