USE REFLECTION TO DETERMINE PRIMITIVE PROPERTIES Java reflection is a powerful application program interface (API) for examining and performing operations on objects at runtime. It allows the coder to look at an unknown object and retrieve information about its features, such as its methods, JavaBean properties, and inheritence trees. Two types of values exist in Java. The first is the class type, which is the building block of object-orientation that defines the object properties within a class. The second is the primitive type. Reflection is most commonly used with class values, but it's also easy to use with Java primitives. The primitive types in Java are derived from C-based syntax. They are: boolean byte short int long float double char There is a Java class associated with each primitive type. These classes exist in the java.lang package, which is automatically imported into all source files. Special constants on the java.lang primitive class wrappers represent the type of primitive instead of the class. For example, Integer.TYPE represents the type 'int' rather than the type 'Integer' and Byte.TYPE represents 'byte'. This makes it possible to create generic components that act upon an unknown JavaBean. Here's an example of a snippet that sets the values in a JavaBean from an incoming HttpServletRequest: // thrown Exceptions are left out for ease of reading... Object bean = .... BeanInfo bi = Introspector.getBeanInfo(bean.getClass( )); PropertyDescriptor[ ] pds = bi.getPropertyDescriptors( ); for(int i=0; i