Hello,

I've tried to cache the introspection results by reusing instances of
XMLIntrospector. But it turned out that simply calling
setXMLIntrospector on an instance of BeanReader won't do the job
completely. I think the reason is that addBeanCreateRule is not called
when setting the Introspector.

The problem can be fixed by changing BeanReader#setXMLIntrospector to
something similar to the following:

        public void setXMLIntrospector(XMLIntrospector introspector) {
                this.introspector = introspector;

                if (introspector != null) {
                        final Iterator it =
introspector.getRegistry().beanInfoIterator();

                        while (it.hasNext()) {
                                XMLBeanInfo xmlInfo = (XMLBeanInfo)
it.next();
        
registeredClasses.add(xmlInfo.getBeanClass());

                                ElementDescriptor elementDescriptor =
xmlInfo
                                                .getElementDescriptor();

                                String path =
elementDescriptor.getQualifiedName();

                                addBeanCreateRule(path,
elementDescriptor, xmlInfo.getBeanClass());
                        }
                }
        }


Or am I missing something? Worth putting this into JIRA ?


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

Reply via email to