ExpressionFormat API Example
Posted: 06 Feb 2013, 03:26
Here's an example on how to use FileBots ExpressionFormat API.
Java:
Output:
PS: You're welcome to use FileBot as API. Most of the (non-GUI) code is written as API anyway. Make sure to give me some credits though. 
Java:
Code: Select all
public static class Bindings {
@Define("r")
public int getRandom() {
return Math.abs(new Random().nextInt());
}
};
public static void main(String[] args) throws Exception {
ExpressionFormat template = new ExpressionFormat("Random number = {r}");
System.out.println(template.format(new Bindings()));
}
Code: Select all
Random number = 1232064860
