On 7/26/05, Ed Griebel <[EMAIL PROTECTED]> wrote:
> I had this issue where class was getting populated. Since it was for
> logging display, I didn't want the long class name displayed and ended
> up removing 'class' from the map if it was in there. It's much easier
> than defining (and agreeing on!) these "special" fields in an object.
> 

That seems like the right pragmatic answer.

> The only change I could get behind is if there was a
> "PropertyUtils.describePrimitives()" which would only return primitive
> types and String, but this would have little usefulness because it's
> so specific.

You should note that PropertyUtils.describe() simply delegates to the
standard JavaBeans introspection functionality to determine what the
properties of the bean class are ... and, based on the property method
naming rules, every Java class does indeed have a readonly property
named "class" due to the existence of the getClass() method that is
inherited from  java.lang.Object.

You should also note that you can dictate what the available
properties are, and even use getter and setter method names that do
not conform to the standard design patterns, if you supply a
FooBeanInfo class to go along with your Foo class -- see the JavaBeans
spec for more information.  But that's more work than makes sense in
this particular use case.

> 
> -ed
> 

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to