org.niggle.templates.freemarkerimpl
Class RecordWrapper
java.lang.Object
|
+--freemarker.template.LazyTemplateModel
|
+--freemarker.template.SimpleHash
|
+--org.niggle.templates.freemarkerimpl.RecordWrapper
- All Implemented Interfaces:
- java.io.Serializable, freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateModel
- public class RecordWrapper
- extends freemarker.template.SimpleHash
A freemarker template model specifically designed
to "wrap" a niggle data record.
- Author:
- Jonathan Revusky
- See Also:
- Serialized Form
Method Summary |
freemarker.template.TemplateModel |
get(java.lang.String key)
|
Record |
getRecord()
|
protected freemarker.template.TemplateModel |
getWrappedFieldValue(FieldDescriptor field)
wrap the field value as a Freemarker TemplateModel
You can override this method in a subclass if
if you want special (ad-hoc) treatment of a given
field. |
protected freemarker.template.TemplateModel |
reflectionCheck(java.lang.String key)
This method allows us to automatically expose "variables" via
the getXXX naming patterns within record subtype classes. |
protected void |
setRecord(Record rec)
|
Methods inherited from class freemarker.template.SimpleHash |
isEmpty, keys, put, put, remove, size, synchronizedWrapper, toString, values |
Methods inherited from class freemarker.template.LazyTemplateModel |
getObjectWrapper, setDefaultObjectWrapper, setObjectWrapper, wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
rec
protected Record rec
RecordWrapper
public RecordWrapper()
setRecord
protected void setRecord(Record rec)
getRecord
public Record getRecord()
get
public freemarker.template.TemplateModel get(java.lang.String key)
throws freemarker.template.TemplateModelException
- Specified by:
get
in interface freemarker.template.TemplateHashModel
- Overrides:
get
in class freemarker.template.SimpleHash
freemarker.template.TemplateModelException
getWrappedFieldValue
protected freemarker.template.TemplateModel getWrappedFieldValue(FieldDescriptor field)
throws freemarker.template.TemplateModelException
- wrap the field value as a Freemarker TemplateModel
You can override this method in a subclass if
if you want special (ad-hoc) treatment of a given
field.
freemarker.template.TemplateModelException
reflectionCheck
protected freemarker.template.TemplateModel reflectionCheck(java.lang.String key)
- This method allows us to automatically expose "variables" via
the getXXX naming patterns within record subtype classes.