simple.template.layout
Interface ViewerFactory


public interface ViewerFactory

The ViewerFactory serves to resolve a template view from a specified path. The location of the template is dependant on the implementation. This is used to interface directly with the templating system used so that the API can be hidden under a known interface, the Viewer.

Author:
Niall Gallagher

Method Summary
 Viewer getInstance(java.lang.String path, java.lang.Object data, boolean share)
          Creates a new Viewer object, which wraps the referenced template.
 

Method Detail

getInstance

Viewer getInstance(java.lang.String path,
                   java.lang.Object data,
                   boolean share)
                   throws java.lang.Exception
Creates a new Viewer object, which wraps the referenced template. Resolving the location of the template to load is left up the implementation. The view created by this method is transient, that is, it exists locally only. This means that changes to the properties of any created Viewer object affect only that instance.

To provide an initial set of properties to the template a data source is provided. The type of data source used will be implementation dependant.

Parameters:
path - this is the path used to locate the template
data - the data source object to use for properties
share - should the data model be inherited or shared
Throws:
java.lang.Exception