|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.ext.freemarker.TemplateRepresentation
public class TemplateRepresentation
FreeMarker template representation. Useful for dynamic string-based representations.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
TemplateRepresentation(Representation templateRepresentation,
Configuration config,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(Representation templateRepresentation,
Configuration config,
java.lang.Object dataModel,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(java.lang.String templateName,
Configuration config,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(java.lang.String templateName,
Configuration config,
java.lang.Object dataModel,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(Template template,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(Template template,
java.lang.Object dataModel,
MediaType mediaType)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
getDataModel()
Returns the template's data model. |
java.lang.Object |
setDataModel(java.lang.Object dataModel)
Sets the template's data model. |
java.lang.Object |
setDataModel(Request request,
Response response)
Sets the template's data model from a request/response pair. |
java.lang.Object |
setDataModel(Resolver<java.lang.Object> resolver)
Sets the template's data model from a resolver. |
void |
write(java.io.OutputStream outputStream)
Writes the datum as a stream of bytes. |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream, release |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, getReader, write, write |
Methods inherited from class org.restlet.resource.Representation |
---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateRepresentation(Representation templateRepresentation, Configuration config, MediaType mediaType)
templateRepresentation
- The FreeMarker template provided via a representation.config
- The FreeMarker configuration.mediaType
- The representation's media type.public TemplateRepresentation(Representation templateRepresentation, Configuration config, java.lang.Object dataModel, MediaType mediaType)
templateRepresentation
- The FreeMarker template provided via a representation.config
- The FreeMarker configuration.dataModel
- The template's data model.mediaType
- The representation's media type.public TemplateRepresentation(java.lang.String templateName, Configuration config, MediaType mediaType)
templateName
- The FreeMarker template's name. The full path is resolved by
the configuration.config
- The FreeMarker configuration.mediaType
- The representation's media type.public TemplateRepresentation(java.lang.String templateName, Configuration config, java.lang.Object dataModel, MediaType mediaType)
templateName
- The FreeMarker template's name. The full path is resolved by
the configuration.config
- The FreeMarker configuration.dataModel
- The template's data model.mediaType
- The representation's media type.public TemplateRepresentation(Template template, MediaType mediaType)
template
- The FreeMarker template.mediaType
- The representation's media type.public TemplateRepresentation(Template template, java.lang.Object dataModel, MediaType mediaType)
template
- The FreeMarker template.dataModel
- The template's data model.mediaType
- The representation's media type.Method Detail |
---|
public java.lang.Object getDataModel()
public java.lang.Object setDataModel(java.lang.Object dataModel)
dataModel
- The template's data model.
public java.lang.Object 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 java.lang.Object setDataModel(Resolver<java.lang.Object> resolver)
resolver
- The resolver.
public void write(java.io.OutputStream outputStream) throws java.io.IOException
write
in class Representation
outputStream
- The stream to use when writing.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |