How about the following scenario -- suppose you have N messages represented by N derived classes. Suppose you stick the following associations in a properties file (or a preferences object)
Given a 'MSG_i'
string, it is easy to find the associated fully qualified classname (if it exists). Given this name, the following snippet instantiates the corresponding object:
et voila. If a new message is introduced, simply add a new derived class for it in your jar and add a line to the properties (of preferences) file.
kind regards