public class TemplateRepresentation extends WriterRepresentation
| Modifier and Type | Field and Description |
|---|---|
protected org.thymeleaf.context.IContext |
context
The template's data model.
|
UNKNOWN_SIZE| Constructor and Description |
|---|
TemplateRepresentation(String templateName,
Locale locale,
Map<String,Object> dataModel,
MediaType mediaType)
Constructor.
|
TemplateRepresentation(String templateName,
Locale locale,
MediaType mediaType)
Constructor.
|
TemplateRepresentation(String templateName,
org.thymeleaf.TemplateEngine engine,
Locale locale,
Map<String,Object> dataModel,
MediaType mediaType)
Constructor.
|
TemplateRepresentation(String templateName,
org.thymeleaf.TemplateEngine engine,
Locale locale,
MediaType mediaType)
Constructor.
|
TemplateRepresentation(TemplateRepresentation templateRepresentation,
Locale locale,
MediaType mediaType)
Constructor based on a Thymeleaf 'encoded' representation.
|
TemplateRepresentation(TemplateRepresentation templateRepresentation,
org.thymeleaf.TemplateEngine engine,
Locale locale,
MediaType mediaType)
Constructor based on a Thymeleaf 'encoded' representation.
|
| Modifier and Type | Method and Description |
|---|---|
static org.thymeleaf.TemplateEngine |
createTemplateEngine()
Returns a new instance of
TemplateEngine based by default on a
TemplateResolver returned by calling
createTemplateResolver(). |
static org.thymeleaf.TemplateEngine |
createTemplateEngine(org.thymeleaf.templateresolver.ITemplateResolver resolver)
Returns a new instance of
TemplateEngine based by default on a
TemplateResolver returned by calling
createTemplateResolver(). |
static org.thymeleaf.templateresolver.ITemplateResolver |
createTemplateResolver()
Returns a new instance of
ITemplateResolver with default
configuration (XHTML template model, templates located inside
"/WEB-INF/templates/", suffixed by ".html". |
Locale |
getLocale()
Returns the representation's locale.
|
String |
getTemplateName()
Returns the template's name.
|
protected void |
setContext(org.thymeleaf.context.IContext context)
Sets the Thymeleaf context.
|
void |
setDataModel(Map<String,Object> dataModel)
Sets the template's data model.
|
void |
setDataModel(Request request,
Response response)
Sets the template's data model from a request/response pair.
|
void |
setDataModel(Resolver<Object> resolver)
Sets the template's data model from a resolver.
|
void |
setTemplateName(String templateName)
Sets the template's name.
|
void |
write(Writer writer)
Writes the datum as a stream of characters.
|
getReadergetChannel, getStream, write, writeappend, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringprotected volatile org.thymeleaf.context.IContext context
public TemplateRepresentation(String templateName, Locale locale, Map<String,Object> dataModel, MediaType mediaType)
templateName - The Thymeleaf template's name. The actual template is
retrieved using the Thymeleaf configuration.locale - The locale of the template.dataModel - The Thymeleaf template's data model.mediaType - The representation's media type.public TemplateRepresentation(String templateName, Locale locale, MediaType mediaType)
templateName - The Thymeleaf template's name. The full path is resolved by
the configuration.locale - The locale of the template.mediaType - The representation's media type.public TemplateRepresentation(String templateName, org.thymeleaf.TemplateEngine engine, Locale locale, Map<String,Object> dataModel, MediaType mediaType)
templateName - The Thymeleaf template's name. The actual template is
retrieved using the Thymeleaf configuration.engine - The template engine.locale - The locale of the template.dataModel - The Thymeleaf template's data model.mediaType - The representation's media type.public TemplateRepresentation(String templateName, org.thymeleaf.TemplateEngine engine, Locale locale, MediaType mediaType)
templateName - The Thymeleaf template's name. The full path is resolved by
the configuration.locale - The locale of the templatemediaType - The representation's media type.public TemplateRepresentation(TemplateRepresentation templateRepresentation, Locale locale, MediaType mediaType) throws IOException
templateRepresentation - The representation to 'decode'.locale - The locale of the template.mediaType - The representation's media type.IOExceptionParseErrorExceptionResourceNotFoundExceptionpublic TemplateRepresentation(TemplateRepresentation templateRepresentation, org.thymeleaf.TemplateEngine engine, Locale locale, MediaType mediaType) throws IOException
templateRepresentation - The representation to 'decode'.engine - The template engine.locale - The locale of the template.mediaType - The representation's media type.IOExceptionParseErrorExceptionResourceNotFoundExceptionpublic static org.thymeleaf.TemplateEngine createTemplateEngine()
TemplateEngine based by default on a
TemplateResolver returned by calling
createTemplateResolver().TemplateEnginepublic static org.thymeleaf.TemplateEngine createTemplateEngine(org.thymeleaf.templateresolver.ITemplateResolver resolver)
TemplateEngine based by default on a
TemplateResolver returned by calling
createTemplateResolver().TemplateEnginepublic static org.thymeleaf.templateresolver.ITemplateResolver createTemplateResolver()
ITemplateResolver with default
configuration (XHTML template model, templates located inside
"/WEB-INF/templates/", suffixed by ".html".ITemplateResolver.public Locale getLocale()
public String getTemplateName()
protected void setContext(org.thymeleaf.context.IContext context)
context - The Thymeleaf contextpublic void setDataModel(Map<String,Object> dataModel)
dataModel - The template's data model.public void setDataModel(Request request, Response response)
request - The request where data are located.response - The response where data are located.Resolver,
Resolver.createResolver(Request, Response)public void setDataModel(Resolver<Object> resolver)
resolver - The resolver.public void setTemplateName(String templateName)
templateName - The template's name.public void write(Writer writer) throws IOException
write in class Representationwriter - The writer to use when writing.IOExceptionCopyright © 2005–2015. All rights reserved.