|
||||||||||
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.velocity.TemplateRepresentation
public class TemplateRepresentation
Velocity template representation. Useful for dynamic string-based representations.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Variant |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
TemplateRepresentation(String templateName,
Map<String,Object> dataModel,
MediaType mediaType)
Constructor. |
|
TemplateRepresentation(String templateName,
MediaType mediaType)
Constructor. |
Method Summary | |
---|---|
Map<String,Object> |
getDataModel()
Returns the template's data model. |
org.apache.velocity.app.VelocityEngine |
getEngine()
Returns the Velocity engine. |
Map<String,Object> |
setDataModel(Map<String,Object> dataModel)
Sets the template's data model. |
void |
write(OutputStream outputStream)
Writes the datum as a stream of bytes. |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, write |
Methods inherited from class org.restlet.resource.Representation |
---|
getText, isAvailable, isTransient, setAvailable, setTransient |
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 |
Constructor Detail |
---|
public TemplateRepresentation(String templateName, MediaType mediaType)
templateName
- The Velocity template's name. The full path is resolved by
the configuration.mediaType
- The representation's media type.public TemplateRepresentation(String templateName, Map<String,Object> dataModel, MediaType mediaType)
templateName
- The Velocity template's name. The full path is resolved by
the configuration.dataModel
- The Velocity template's data model.mediaType
- The representation's media type.Method Detail |
---|
public org.apache.velocity.app.VelocityEngine getEngine()
public Map<String,Object> getDataModel()
public Map<String,Object> setDataModel(Map<String,Object> dataModel)
dataModel
- The template's data model.
public void write(OutputStream outputStream) throws IOException
write
in class OutputRepresentation
outputStream
- The stream to use when writing.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |