Posts

Showing posts from August 9, 2007

Reflection APIs - A way to inspect classes at runtime

Java Reflection is a technology that looks inside a Java object at runtime and sees basically everything about the object that you would know at compile time. Java Reflection is a technology that looks inside a Java object at runtime and sees what variables it contains, what methods it supports, what interfaces it implements, what classes it extends—basically everything about the object that you would know at compile time. The Reflection API is located in the java.lang.reflect package and is included in any J2SE installation. Primarily it is intended for very generic programs such as database browsers or visual code editors, but it can be used in any other applications. Reflection is for Basic techniques There are two basic techniques involved in Reflection: discovery and use by name. Here are descriptions of both: Discovery involves taking an object or class and discovering the members, superclasses, implemented interfaces, and then possibly using the discovered e