|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rtf.template.AbstractTemplateEngine
public abstract class AbstractTemplateEngine
| Field Summary | |
|---|---|
protected java.util.Map |
formats
Formats to use for formatting of values. |
protected java.io.Reader |
template
Reader that contains the template. |
| Constructor Summary | |
|---|---|
AbstractTemplateEngine()
|
|
| Method Summary | |
|---|---|
protected java.lang.Object |
escapeSpecialCharacters(java.lang.Object value)
Escape special chracters { and } with \{ and \} otherwise, RTF document generated is not valid. |
IContext |
getContext()
|
java.text.Format |
getDefaultFormat(java.lang.Class clazz)
Get the default format for a given class. |
IContext |
initializeContext()
Initialize context. |
void |
merge(java.io.File file)
Merge. |
void |
merge(java.lang.String file)
Merge. |
void |
merge(java.io.Writer writer)
Merge. |
protected abstract void |
mergeWithTemplateEngine(java.io.Writer writer)
|
boolean |
mustBeEscaped(java.lang.Object value)
Return true if value must be escaped and false otherwise |
void |
put(java.lang.String key,
java.lang.Object value)
Put a value for the given key. |
protected void |
setContext(IContext context)
|
void |
setDefaultFormat(java.lang.Class clazz,
java.text.Format format)
Set the default format for a given class. |
void |
setFormatMap(java.util.Map commonFormats)
Use a pre-populated formats map as the map for this template |
void |
setGlobalContext(IContext globalContext)
Use a pre-populated Context. |
void |
setTemplate(java.io.Reader template)
Set the template to use |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sourceforge.rtf.ITemplateEngine |
|---|
newContext |
| Field Detail |
|---|
protected java.util.Map formats
protected java.io.Reader template
| Constructor Detail |
|---|
public AbstractTemplateEngine()
| Method Detail |
|---|
public void put(java.lang.String key,
java.lang.Object value)
put in interface ITemplateEnginekey - value -
public void merge(java.lang.String file)
throws java.lang.Exception
merge in interface ITemplateEnginefile - name of file to merge into
java.lang.Exception
public void merge(java.io.File file)
throws java.lang.Exception
merge in interface ITemplateEnginefile - file to merge into
java.lang.Exception
public void merge(java.io.Writer writer)
throws java.lang.Exception
ITemplateEngine
merge in interface ITemplateEnginewriter - writer to merge into
java.lang.Exceptionpublic void setFormatMap(java.util.Map commonFormats)
commonFormats - a pre-built map of formats
public void setDefaultFormat(java.lang.Class clazz,
java.text.Format format)
setDefaultFormat in interface ITemplateEngineclazz - class to set format forformat - format to use for instances of the given classpublic java.text.Format getDefaultFormat(java.lang.Class clazz)
clazz - class to get default format for
protected void setContext(IContext context)
public IContext getContext()
getContext in interface ITemplateEnginepublic void setTemplate(java.io.Reader template)
ITemplateEngine
setTemplate in interface ITemplateEnginepublic boolean mustBeEscaped(java.lang.Object value)
value -
protected java.lang.Object escapeSpecialCharacters(java.lang.Object value)
value -
public IContext initializeContext()
ITemplateEngine
initializeContext in interface ITemplateEnginepublic void setGlobalContext(IContext globalContext)
setGlobalContext in interface ITemplateEngineinnerContext - a pre-populated Context object
protected abstract void mergeWithTemplateEngine(java.io.Writer writer)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||