D
Daniel Pitts
I have some generic reflection based code which "clears" a JavaBean
based on the PropertyDescriptors. Initially, I set everything to "null"
which worked until I put a boolean (not Boolean) in one of my beans.
I special cased boolean, and that is fine, but I know that sometime
someone is going to ask for an "int" or a "long", etc...
I have the Class<?> from the propertyDescriptor and was wondering if
there was any easy way to map from that Class<?> to an appropriate
"default" wrapper? If there isn't a built-in way, I can always use a
Map<Class<?>, Object>, and just initialize it with new Integer(0), new
Double(0), etc...
Not quite the best approach in my opinion.
based on the PropertyDescriptors. Initially, I set everything to "null"
which worked until I put a boolean (not Boolean) in one of my beans.
I special cased boolean, and that is fine, but I know that sometime
someone is going to ask for an "int" or a "long", etc...
I have the Class<?> from the propertyDescriptor and was wondering if
there was any easy way to map from that Class<?> to an appropriate
"default" wrapper? If there isn't a built-in way, I can always use a
Map<Class<?>, Object>, and just initialize it with new Integer(0), new
Double(0), etc...
Not quite the best approach in my opinion.