StringVars v1.0.1
This is the second public release of the library, it has been heavily tested but please feel free to report any issues found.
To add it as a…
Read MorePublished 02/18/2023 Updated 02/23/2023
StringVars is a zero dependency pure Java solution to create recursive String variables, such as $var$ or %var%.
StringVars uses a map to fetch the value associated with a given key. If the value contains other variables, it recursively retrieves and replaces them.Add the following to your pom.xml as a maven dependency, or just download the latest release and import it with your IDE.
<dependency>
<groupId>com.konloch</groupId>
<artifactId>StringVars</artifactId>
<version>1.0.1</version>
</dependency>
Click here for the StringHolderExample class
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"));
This is the second public release of the library, it has been heavily tested but please feel free to report any issues found.
To add it as a…
Read MoreThis is the first public release of the library, it has been heavily tested but please feel free to report any issues found.
To add it as a…
Read More