simple.template
Interface Container

All Superinterfaces:
Database
All Known Implementing Classes:
Environment, FreemarkerContainer, PageContainer, VelocityContainer

public interface Container
extends Database

The Container object represents an interface to the templating system used by the TemplateEngine. A container represents a logical database of information that can be shared between controller objects and documents. It is also used to acquire documents using a URI path structure.

Author:
Niall Gallagher

Method Summary
 boolean exists(java.lang.String path)
          Determines whether the named template exists.
 Document lookup(java.lang.String path)
          Looks for the named template and wraps the template within a new Document instance.
 
Methods inherited from interface simple.template.Database
contains, get, keySet, put, remove
 

Method Detail

lookup

Document lookup(java.lang.String path)
                throws java.lang.Exception
Looks for the named template and wraps the template within a new Document instance. Resolving the location of the template is left up the templating system, typically this requires a file path reference to locate the template.

The document created by this method is transient, that is, it is a unique instance. This means that changes to the properties of any created document object affect only that instance. All documents retrieved should use UTF-8 encoding.

Parameters:
path - this is the path used to locate the template
Returns:
the specified template wrapped within a document
Throws:
java.lang.Exception - this is thrown if the is a problem with locating or rendering the specified template

exists

boolean exists(java.lang.String path)
Determines whether the named template exists. This is used to determine if the lookup method will locate a template given the specified path. If the template is accessable this returns true, otherwise false is returned.

Parameters:
path - this is the path used to locate the template
Returns:
true if the template exists, false if it does not