A
Allen
In my PluginRegisterManager class, there is a Vector registerVector
which stores all kinds of registered handlers as Object type. So I
need to get specified kind of handlers, i.e.
PluginFileHandler[] handlers = manager.getPluginFileHandler();
Because registerVector is defined as:
Vector<Object> registerVector;
Then if I want to get paint handlers, I have to write exactly the same
codes as getPluginFileHandler() except check instanceof
PluginPaintHandler.
How to use class type as argument? If this is feasible, I just need
only one function named getHandler(<classtype>).
which stores all kinds of registered handlers as Object type. So I
need to get specified kind of handlers, i.e.
PluginFileHandler[] handlers = manager.getPluginFileHandler();
Because registerVector is defined as:
Vector<Object> registerVector;
Then if I want to get paint handlers, I have to write exactly the same
codes as getPluginFileHandler() except check instanceof
PluginPaintHandler.
How to use class type as argument? If this is feasible, I just need
only one function named getHandler(<classtype>).