Translate

Показ дописів із міткою Reflection. Показати всі дописи
Показ дописів із міткою Reflection. Показати всі дописи

середа, 17 липня 2013 р.

Java’s Reflection API


If you have ever asked yourself questions like these:
– “How do I invoke a method, having only its name in a String?”
- “How do I list all the attributes in a class dynamically?”
- “How do I write a method that resets the state of any given object to default values?”
Then you have probably already heared of Java’s Reflection API, and in case you haven’t, this is a good opportunity to see what it’s all about, and what it can be used for. This feature is really powerful, but as always, has to be used with some good judgement.