The solution to that could be Reflection, but it is slow and often overkill. FreeMarker objects are of a known interface and as such, are simply accessed. Kevin Kevin, Actually, FreeMarker also supports that task, but, since it was beyond the scope of my discussion, I left it out of the article. But the nice thing is that you can extend SimpleHash so that it further processes the data you receive, if that fits into your workflow. The difference between using a singleton over a class with static methods boils down to effective object-oriented design.
Singletons normally represent a cleaner approach.
A class of static methods, unfortunately, breaks down to a simple list of functions, or utilities. A class may have static variables as well as static methods. Practically speaking, if the Singleton pattern uses a class that may only have one instance, then a Java class with only static methods and static variables seems like an elegant and simple way to create a singleton. The classic approach morphs easily into a flyweight-pattern limited pool of instances. But on the other hand, with the static implementation, all your code accessing the singleton will be simpler because no extra calls will grab the instance.