|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.template.TemplateEngine
public class TemplateEngine
The TemplateEngine
provides the core functionality
required to process templates. This provides an implementation of
the ResourceEngine
interface, and as such is used to
acquire resources using a HTTP URI. The Resource
objects served by this are loaded and mapped using the mapping
functionality found in the MapperEngine
. This means
that resource implementations, known as services or controllers,
can be implemented and placed in a specific directory, and once
the objects are referenced they will be loaded and served.
Typically the Resource
objects served by this will
be implementations of the Action
, which enables
them to interact with a shared environment. The action services,
often referred to as controller services, are similar in concept
to a Java Servlets and allow event based request and response
objects to be processed.
This requires a Container
implementation in order
to configure itself. The container provided is used to look for
templates and set properties that are accessable to all service
objects loaded by this engine, also, properties set with the
container will be accessable to all templates processed.
Constructor Summary | |
---|---|
TemplateEngine(Context context,
Container system)
Constructor for the TemplateEngine object. |
|
TemplateEngine(Context context,
Container system,
java.io.File base)
Constructor for the TemplateEngine object. |
|
TemplateEngine(Context context,
Environment system,
java.io.File base)
Constructor for the TemplateEngine object. |
Method Summary | |
---|---|
Resource |
resolve(java.lang.String target)
This will look for and retrieve the requested resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateEngine(Context context, Container system) throws java.lang.Exception
TemplateEngine
object. The
instance created by this provides a mapping resource engine
that loads and instantiates referenced services using the
simple.http.load.MapperEngine
to resolve the
class names for services. Each loaded controller service is
instantiated using an Environment
object.
context
- this is the context used by this enginesystem
- this provides the environment for controllers
java.lang.Exception
- if there is a problem on initializationpublic TemplateEngine(Context context, Container system, java.io.File base) throws java.lang.Exception
TemplateEngine
object. The
instance created by this provides a mapping resource engine
that loads and instantiates referenced services using the
simple.http.load.MapperEngine
to resolve the
class names for services. Each loaded controller service is
instantiated using an Environment
object. The
file specified acts as a local file system classpath.
context
- this is the context used by this enginesystem
- the interface to the templating system usedbase
- this is the local file system classpath used
java.lang.Exception
- if there is a problem on initializationpublic TemplateEngine(Context context, Environment system, java.io.File base) throws java.lang.Exception
TemplateEngine
object. The
instance created by this provides a mapping resource engine
that loads and instantiates referenced services using the
simple.http.load.MapperEngine
to resolve the
class names for services. Each loaded controller service is
instantiated using an Environment
object. The
file specified acts as a local file system classpath.
context
- this is the context used by this enginesystem
- the interface to the templating system usedbase
- this is the local file system classpath used
java.lang.Exception
- if there is a problem on initializationMethod Detail |
---|
public Resource resolve(java.lang.String target)
Resource
implementation that is
acquired. Typically the implementation returned by this is
an Action
, however it can be any object that
implements the Service
object.
resolve
in interface ResourceEngine
target
- the URI style path that represents the target
Resource
object refereed to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |