simple.template
Class Controller
java.lang.Object
simple.http.serve.Component
simple.http.load.Service
simple.template.Controller
- All Implemented Interfaces:
- Resource
- Direct Known Subclasses:
- Action, View
public abstract class Controller
- extends Service
The Controller
object represents a service that can
access documents and properties provided by the templating system
environment. Each controller implementation will have access to
the documents via the lookup
methods.
- Author:
- Niall Gallagher
- See Also:
TemplateEngine
Field Summary |
protected Configuration |
data
This is the configuration object for this service object. |
protected Environment |
system
Represents the environment the controller exists within. |
Constructor Summary |
Controller(Context context)
Constructor for the Controller object. |
Method Summary |
void |
prepare(Configuration data)
This can be overridden by a subclass to perform preparation
of the controller. |
void |
prepare(Configuration data,
Environment system)
Initialize the controller with the environment used by the
templating engine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
system
protected Environment system
- Represents the environment the controller exists within.
data
protected Configuration data
- This is the configuration object for this service object.
Controller
public Controller(Context context)
- Constructor for the
Controller
object. This will
create a controller using the provided context. A controller
is a typical service implementation, which is a resource.
- Parameters:
context
- the context this controller is rooted at
prepare
public void prepare(Configuration data,
Environment system)
throws LoadingException
- Initialize the controller with the environment used by the
templating engine. This can be overridden by a subclass to
perform some setup tasks for the service.
- Parameters:
system
- the environment used by the template enginedata
- this is the configuration for this service
- Throws:
LoadingException
- thrown if the preparation fails
prepare
public void prepare(Configuration data)
throws java.lang.Exception
- This can be overridden by a subclass to perform preparation
of the controller. It is generally recommended that this is
overridden so that the
Environment
is always
set for the subclass. This is provided for convinience.
- Parameters:
data
- this is the configuration for this service
- Throws:
java.lang.Exception
- thrown if there is a preparation failure