02-19-2023, 07:45 AM
About: StringVars is a zero dependency pure Java solution to create recursive String variables, such as $var$ or %var%.
License: Public Domain
Source: https://konloch.com/StringVars/
Download Jar: https://konloch.com/StringVars/releases/
Add as maven dependency:
Implementation Example
Click here for the StringHolderExample class
License: Public Domain
Source: https://konloch.com/StringVars/
Download Jar: https://konloch.com/StringVars/releases/
Add as maven dependency:
Code:
<dependency>
<groupId>com.konloch</groupId>
<artifactId>StringVars</artifactId>
<version>1.0.0</version>
</dependency>
Implementation Example
Click here for the StringHolderExample class
Code:
StringHolderExample example = new StringHolderExample()
{
@Override
public String getString(String key)
{
return StringVars.getVariableValue('$', ()-> getMap().get(key),(vkey)-> getMap().get(vkey));
}
};
example.getMap().put("example", "Example: $var$");
example.getMap().put("var", "This is a great example of how it functions!");
System.out.println("Results: " + example.getString("example"));