1 Template

Class Ax.freemarker.Template


Constructor Summary

MethodDescription
JSFreemarker(String text)Creates a new Freemarker engine instance.

Method Summary

Modifier and TypeMethodDescription
String process(String name, Object data)Processes the data in an Object.
String process(Map data)Processes the data in the JSON in the template.
JSFreemarker setDateFormat(String dateFormat)Sets the date format to use.
JSFreemarker setLanguage(String lang)Sets the language to use, like en-US | en-GB | es_ES .
JSFreemarker setNumberFormat(String numberFormat)Sets the number format to use, like 0.

Method Detail

JSFreemarker

 JSFreemarker(String text)
Info:
Creates a new Freemarker engine instance.
Parameters:
text - template to use

process

                        String process(String name, Object data)
Info:
Processes the data in an Object. It also gives the data a name, that is used in the template to refer it. Object can be a JSResultSet.
Parameters:
name - name to give to the data object
data - data to process
Returns:
String with the processed template filled with the data

process

                        String process(Map data)
Info:
Processes the data in the JSON in the template.
Parameters:
data - map(JSON) with the data
Returns:
String with the processed template filled with the data

setDateFormat

                        JSFreemarker setDateFormat(String dateFormat)
Info:
Sets the date format to use.
Parameters:
dateFormat - date format
Returns:
same object with date format updated

setLanguage

                        JSFreemarker setLanguage(String lang)
Info:
Sets the language to use, like en-US | en-GB | es_ES .
Parameters:
lang - language
Returns:
same object with language updated

setNumberFormat

                        JSFreemarker setNumberFormat(String numberFormat)
Info:
Sets the number format to use, like 0.#### .
Parameters:
numberFormat - number format
Returns:
same object with number format updated