|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfreemarker.template.cache.TemplateRegistry
public class TemplateRegistry
Stores a register of prototype templates, which can be retrieved by the template cache whenever it needs to compile a template. This allows the cache to store and retrieve different template implementations as required.
This is an implementation of the Parameterized Factory Method pattern.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,Cacheable> |
m_cTemplates
A map of template types that can be instantiated by this object. |
Constructor Summary | |
---|---|
TemplateRegistry()
Creates new TemplateRegistry . |
|
TemplateRegistry(TemplateRegistry cOriginal)
Creates a new TemplateRegistry as a clone of an existing
one. |
Method Summary | |
---|---|
void |
addTemplate(java.lang.String aName,
Cacheable cTemplate)
Adds a prototype template to the registry. |
java.lang.Object |
clone()
Clones the current registry, and returns the clone back to the caller. |
Cacheable |
getTemplate(java.lang.String aKey)
Retrieve a cloned template from the registry. |
protected void |
registerDefaultTemplates()
Registers the templates that will be held in this template registry. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,Cacheable> m_cTemplates
Constructor Detail |
---|
public TemplateRegistry()
TemplateRegistry
.
public TemplateRegistry(TemplateRegistry cOriginal)
TemplateRegistry
as a clone of an existing
one.
cOriginal
- the original TemplateRegistry
to be
clonedMethod Detail |
---|
protected void registerDefaultTemplates()
public Cacheable getTemplate(java.lang.String aKey)
aKey
- the type of template to retrievepublic void addTemplate(java.lang.String aName, Cacheable cTemplate)
aName
- the name of the prototype templatecTemplate
- the prototype template itselfpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
TemplateRegistry
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of the object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |