I wanted to substitute the placeholder dynamically in properties in a java application. Like
WelcomeMessage=Welcome Mr. {firstName} {lastName} !!!
<
Another option is adding Apache FreeMarker with no dependencies and define template as:
Welcome Mr. ${firstName} ${lastName} !!!
Apache FreeMarker™ is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language
You can use StringTemplateLoader to load template using String
you can create a StringTemplateLoader and add each template to it: