I have a template with placeholders(e.x. ${PARAM1}), the program successfully resolves them. But what to do if I want to resolve only placeholders which I pass to template engine and leave other ${} ignored? Currently the program fails if it can't resolve all placeholders.
static void main(String[] args) {
def template = this.getClass().getResource('/MyFile.txt').text
def parameters = [
"PARAM1": "VALUE1",
"PARAM2": "VALUE2"
]
def templateEngine = new SimpleTemplateEngine()
def output = templateEngine.createTemplate(template).make(parameters)
print output
}
File: ${PARAM1} ${PARAM2} ${PARAM3}
Thanks