|
|||||||||
| 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,CompileableFactory> |
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 |
addFactory(CompileableFactory cFactory)
Adds a template factory to the registry. |
java.lang.Object |
clone()
Clones the current registry, and returns the clone back to the caller. |
CompileableFactory |
getFactory(java.lang.String aKey)
Retrieve a template factory 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,CompileableFactory> 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
cloned| Method Detail |
|---|
protected void registerDefaultTemplates()
public CompileableFactory getFactory(java.lang.String aKey)
aKey - the type of template factory to retrievepublic void addFactory(CompileableFactory cFactory)
cFactory - the template factory
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.ObjectTemplateRegistry
java.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectString representation of the object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||