An addition to the strategy and code of @palascint@palacsint is to use Reflection
to automatically bind the classes that implement KeyProcessor
to the dictionary. This way, you don't have to add each KeyProcessor
manually and you don't have to remember it.
Make sure that you only 'reflect' once because it is relatively slow. Thus add it to a static block or in the constructor of a singleton.