|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Document
A Document
object represents a template with a
set of properties. This represents a template loaded from some
source that can have specific properties set to configure a
rendering of the template acquired from the templating system.
This interface attempts to encapsulate the functionality provided by the templating system in an in dependant manner. This achieves two things, it ensures that the controller is not tightly coupled to the templating system and ensures that familiarity with the templating system's API is not required.
Method Summary | |
---|---|
java.lang.String |
getContentType()
The content that is dynamically generated by the object is written as a specific MIME type, including charset information which determines the content encoding. |
java.lang.String |
toString()
Produces the generated template output as a string. |
void |
write(java.io.OutputStream out)
Displays the contents of the generated template output to the OutputStream . |
Methods inherited from interface simple.template.Database |
---|
contains, get, keySet, put, remove |
Method Detail |
---|
void write(java.io.OutputStream out) throws java.lang.Exception
OutputStream
. This encapsulates the means
of rendering the template to a single method. Internally
the properties that are set within the document will be
used to configure the template, enabling dynamic output.
If there are any problems parsing the template or emitting its contents an exception is thrown. However, if it is successfully processed it will be written to the issued output, which should remain unflushed for performance. The output is written using the UTF-8 charset.
out
- the output to write the template rendering to
java.lang.Exception
- thrown if there is a problem parsing or
emitting the templatejava.lang.String getContentType()
java.lang.String toString()
This is very useful if the output is to be used as an
SQL query, or an email message. The rendering is stored
conveniently for use as a string and does not require
an OutputStream
to capture the output.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |