org.restlet.ext.freemarker
Class TemplateRepresentation
java.lang.Object
org.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.ext.freemarker.TemplateRepresentation
public class TemplateRepresentation
- extends OutputRepresentation
FreeMarker template representation. Useful for dynamic string-based
representations.
- Author:
- Jerome Louvel (contact@noelios.com)
- See Also:
- FreeMarker home page
Methods inherited from class org.restlet.resource.Variant |
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateRepresentation
public TemplateRepresentation(String templateName,
Configuration config,
Object dataModel,
MediaType mediaType)
- Constructor.
- Parameters:
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.
getDataModel
public Object getDataModel()
- Returns the template's data model.
- Returns:
- The template's data model.
setDataModel
public Object setDataModel(Object dataModel)
- Sets the template's data model.
- Parameters:
dataModel
- The template's data model.
- Returns:
- The template's data model.
write
public void write(OutputStream outputStream)
throws IOException
- Writes the datum as a stream of bytes.
- Specified by:
write
in class OutputRepresentation
- Parameters:
outputStream
- The stream to use when writing.
- Throws:
IOException
Copyright © 2005-2007 Noelios Consulting.