Why even bother with configuration files?
If you really need extensibility, create a class to load plugins from one or more JAR of CLASS files. It would step through all entries in the JAR file using java.util.zip or java.util.jar APIs, can figure out class names from path names, and check for implementations of an interface, abstract class, or subclasses of a concrete class. Pass the file URLs to a URLClassLoader, check with Class.isAssignableFrom, and then your factory can use this information to find all types dynamically. |