commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Pl├╝mpe <thomas.plue...@gmx.de>
Subject Re: [BEANUTILS] Property Descriptor Visibility
Date Tue, 14 Oct 2003 17:20:11 GMT
> >My workaround was to set the class to public and document that it isn't
> >really. Obviously I'd much prefer having getAccessibleMethod rewritten,
> >but am not quite sure how to do that correctly.
> 
> The requirement for a public class is a limitation of introspection in 
> Java that BeanUtils inherits from java.beans.Introspector.  The logic in 
> getAccessibleMethod() took a long time to get to its current state (it 
> includes workarounds for bugs on some JVMs),
I see. I noticed there appears to be a bit of black magic going on. ;)

>  and I'm hesitant to mess 
> with it without a *substantial* suite of test cases to verify we don't 
> break anything.  Unfortunately, I don't have time to work on such a 
> suite at the moment :-(.
> 
> One workaround to exposing more public properties than you really want 
> (which has also been discussed on this thread) is to use a BeanInfo 
> class to describe your bean class.  Using this technique, you can tell 
> the introspector exactly which properties to expose (and even use 
> different method names than the usual design pattern requirements, if 
> you want).  See the JavaBeans Specification for more information:
> 
>   http://java.sun.com/products/javabeans/docs/
Thanks, but I guess for now I'll just keep the superclass public.

Thomas



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message