You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@eng.sun.com on 2000/02/14 20:34:21 UTC

Re: [Catalina] Using XML Parsing Package in "org.apache.tomcat .util.xml"

>    BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass());
>    PropertyDescriptor props[] = beanInfo.getPropertyDescriptors();
>    Method setPropertyMethod=null;
>    for (int i=0; i<props.length; i++) {
>        if (props[i].getName().equals(name)) {
>            setPropertyMethod=props[i].getWriteMethod();

You are right about that. The only problem is that the second style
doesn't work on kaffe ( probably not a big problem for us,
Solaris/Linux.i386/AIX/Windows  users).

And we have to use Class.getMethod for non-property setters. The Bean API
might be a bit heavy for our modest use of introspection, but I agree it
is the "right" way.

Costin