Dmitri, > > The idea of writing a custom JXPathBeanInfo is not that bad. > On the other > hand, I don't see why I could not update the introspector to > recursively > acquire property descriptors for all those parent interfaces.
Yep, this would be nice. I wonder why the java.beans.Introspector() doesn't provide this? At this stage I have chosen to write a custom JXPathBeanInfo that uses reflection to get a list of methods and then constructs a PropertyDescriptor for each. > > The only issue with the use of the JXPathBeanInfo for the > interface is that > the _only_ properties available via the XPaths will be those on the > interface. Any additional properties declared by the class > directly will be > inaccessible. I know. This is exactly what I want. I don't want to expose my entire internal API to the client, just a subset of it to ease maintenance and provide the client with a simplified more specific API. I control this in a NOdePointerFactory impl - it checks the given Bean ojbect for a well-known XPath Interface (about 6 in total) and then uses the methods on the matching XPath interface to create a BeanPointer. A little bit of work but worth the effort. Do you think this use-case of applying an "XPath API" could be applicable to other developers? Definitely high on my list of requirements. steve. > > Would it be possible to get JXPathBeanInfo for the object's > class, not the > interface? > > - Dmitri > > ----- Original Message ----- > From: "Stephen Bartlett" <[EMAIL PROTECTED]> > To: "'Jakarta Commons Developers List'" > <[EMAIL PROTECTED]> > Sent: Thursday, June 13, 2002 7:32 PM > Subject: RE: [JXPATH] Difference in introspection > > > > Dmitri, > > > > I have a NodePointerFactory impl that uses the JXPathIntrospector to > create > > a JXPathBeanInfo object for an Interface. I take it this is > incorrect > > usage?? > > > > Looking at the code > JXPathBasicBeanInfo.getPropertyDEscriptors() tests for > > an Interface but the BeanInfo object returned by > > java.beans.Introspector.getBeanInfo() doesn't recognizes > methods from > super > > interfaces even without a 'stop' class. > > > > I guess I could implement my own JXPathBeanInfo class that > uses reflection > > instead of JavaBeans to create PropertyDescriptors ? > > > > cheers, > > steve. > > > > > -----Original Message----- > > > From: Dmitri Plotnikov [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, 13 June 2002 10:42 PM > > > To: Jakarta Commons Developers List > > > Subject: Re: [JXPATH] Difference in introspection > > > > > > > > > Stephen, > > > > > > > Any reason why Interfaces are introspected differently Objects ? > > > > > > > > When an Interface is introspected "PropertyDescriptors" are > > > created only > > > for > > > > methods defined on the Interface and not for inherited > > > methods. This is > > > not > > > > the case when an Object is introspected. > > > > > > > > Is this expected? I feel it is inconsistent and prevents me > > > from extending > > > > Interfaces. > > > JXPath is not supposed to introspect interfaces - just > > > JavaBeans. How did > > > you get it to introspect an interface? > > > > > > Thanks, > > > > > > > > > > > Steve. > > > > > > - Dmitri > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
