|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.engine.FMModel
public class FMModel
General purpose class for passing object models to a FM-Classic
template. These can be passed in as objects or classes using the
putObject(String, Object)
and putClass(String, Class)
methods.
For occasions where a custom TemplateModel
is required,
these can be added using the putModel(String, freemarker.template.TemplateModel)
method.
Once the model is complete, it can be applied using one of the
FMEngine.apply()
methods.
Field Summary | |
---|---|
protected TemplateHashModel |
m_cInnerModel
|
protected java.util.HashMap<java.lang.String,TemplateModel> |
m_cModel
|
Constructor Summary | |
---|---|
FMModel()
Create a new empty FMModel. |
|
FMModel(FMModel innerModel)
Create a new FMModel that wraps the given inner model. |
|
FMModel(TemplateHashModel innerModel)
Create a new FMModel that wraps the given inner model. |
Method Summary | |
---|---|
FMModel |
putClass(java.lang.String name,
java.lang.Class clz)
Puts the given class into this FMModel, with the given name. |
FMModel |
putClass(java.lang.String name,
java.lang.String className)
Puts the named class into this FMModel, with the given name. |
FMModel |
putModel(java.lang.String name,
TemplateModel model)
Puts the given template model into this FMModel, with the given name. |
FMModel |
putObject(java.lang.String name,
java.lang.Object obj)
Puts the given object into this FMModel, with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final TemplateHashModel m_cInnerModel
protected final java.util.HashMap<java.lang.String,TemplateModel> m_cModel
Constructor Detail |
---|
public FMModel()
FMEngine
object.
public FMModel(TemplateHashModel innerModel)
innerModel
- the inner model to be wrappedpublic FMModel(FMModel innerModel)
innerModel
- the inner model to be wrappedMethod Detail |
---|
public final FMModel putModel(java.lang.String name, TemplateModel model)
name
- the name of the object to be addedmodel
- the template model to be addedpublic final FMModel putObject(java.lang.String name, java.lang.Object obj)
name
- the name of the object to be addedobj
- the object to be addedpublic final FMModel putClass(java.lang.String name, java.lang.Class clz)
name
- the name of the object to be addedclz
- the class to be addedpublic final FMModel putClass(java.lang.String name, java.lang.String className) throws java.lang.ClassNotFoundException
name
- the name of the object to be addedclassName
- the name of the class to be added
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |