<#-- ======================== Start of Main() Code Generation ============= --> <#compress> <#-- remove superfluous white-space --> <#recurse doc> <#-- Strart recursively processing the document --> <#macro pise> <#-- A macro name matched with the label of the node in the doc--> <#-- when this node is found execute the following commands--> <#assign Toolname=.node.command> <#-- Declaration of a varialbe Toolname--> <#assign name=.node.command> <#recurse .node.parameters> <#-- Permit to recursively process the nodes, FreeMaker will look for a macro that matches the label of the node in the doc. In this case it will find 'parameters' --> <#-- ======================== End of Main() Code Generation ============= --> <#-- ======================== Macros ============= --> <#macro parameters><#recurse> <#macro parameter> <#-- change "-" to "_" since Java does not recognize '-' as valid name change " " to "_" since space is not allowed in a Java varname add "_" to name to avoid using common methods names as parent class --> <#assign name = .node.name[0]?default("")> <#assign name = name?replace("[ |-]","_","r")+"_"> <#-- skip parameter when "ishidden" is "1" --> <#if .node.@ishidden[0]?exists && .node.@ishidden[0]?contains("1")><#return> <#switch .node.@type> <#case "Paragraph"> <#-- Take care of the precond for a paragraph--> <#recurse .node.paragraph.parameters> <#break> <#case "InFile"> <#if .node.@ismandatory[0]?exists> You must enter a value for ${name}, an empty String is not acceptable. <#break> <#case "Sequence"> <#case "List"> <#case "Excl"> <#case "String"> <#if .node.@ismandatory[0]?exists> You must enter a value for ${name}, an empty String is not acceptable. <#break> <#case "Integer"> <#if .node.@ismandatory[0]?exists> <#if (.node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node) || (.node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node)> <#if .node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node > ${.node.attributes.scalemin.value} myProperty must be > than "${.node.attributes.scalemin.value}". <#if .node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node> ${.node.attributes.scalemax.value} myProperty must be < than"${.node.attributes.scalemax.value}". true ${name} must be of type Integer You must enter a value for ${name}. <#else> <#if (.node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node) || (.node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node)> <#if .node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node > ${.node.attributes.scalemin.value} myProperty must be > than "${.node.attributes.scalemin.value}". <#if .node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node> ${.node.attributes.scalemax.value} myProperty must be < than"${.node.attributes.scalemax.value}". true ${name} must be of type Integer <#break> <#case "Float"> <#if .node.@ismandatory[0]?exists> <#if (.node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node) || (.node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node)> <#if .node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node > ${.node.attributes.scalemin.value} myProperty must be > than "${.node.attributes.scalemin.value}". <#if .node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node> ${.node.attributes.scalemax.value} myProperty must be < than"${.node.attributes.scalemax.value}". true ${name} must be of type Double You must enter a value for ${name}. <#else> <#if (.node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node) || (.node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node)> <#if .node.attributes.scalemin?is_node && .node.attributes.scalemin.value?is_node > ${.node.attributes.scalemin.value} myProperty must be > than "${.node.attributes.scalemin.value}". <#if .node.attributes.scalemax?is_node && .node.attributes.scalemax.value?is_node> ${.node.attributes.scalemax.value} myProperty must be < than"${.node.attributes.scalemax.value}". true ${name} must be of type Double <#break>