mardi 27 mars 2018

How to override classes in the Java API, thus changing their behaviour using Reflection?

Is it possible to override the Exceptions class and thus inject my own methods into it, thereby changing it's overall behaviour. I believe I read somewhere that it could be done using custom class loaders or some reflection technique? I think it mentioned using a custom class loader to load your custom class rather than loading the default Java API class. If so how might one do this, for instance creating a JOptionPane exception message popup upon calling printStackTrace(e) that alerts the user to the exception message.





Aucun commentaire:

Enregistrer un commentaire