Hi Arnulf,

if you use the stuff I described in my last email, having the
XInterfaceTypeDescription you can directly query for the
XInterfaceMemberTypeDescription. Calling method getMembers you get a sequence
of objects. With these objects you can queryInterface for
XInterfaceAttributeTypeDescription or XInterfaceMethodTypeDescription. If I
remember correctly, you get an empty response if the object is not of the
appropriate type (attribute or method),

Thank you very much! This is really what I would be after, because then one can infer from the type information what fields are really there and has not to infer from set/get methods (which could mean that one guesses wrong, sometimes).

Can't give you a direct example, because the work I am doing is in C++/tcluno.

Just curious: are you workint on a TcL-UNO-interface, which could be exploited outside of Windows (the present support is via ActiveX, Windows-only, I understand)?

To check if it is a method or an attribute you can use
com.sun.star.beans.XIntrospection method inspect on the object
you get back from the getMembers call and afterwards use
com.sun.star.beans.XIntrospectionAccess method hasMethod on the object
returned from the inspect call to check if that is a method or an attribute.
Be carefull, do not use hasProperty (for check if it is an attribute) at
first try, because I have found out that methods are sometimes also
identified as attributes but not the other way around.

Well, for my purpose XIntrospection would suffice, but somehow (have not been able to really trace this down and hence have not been able to come up with a stable nutshell-example so others can get that effect as well) in my configuration the Java based Introspection under OOo 1.1.4 and 1.9.x will become unoperational (cannot instantiate the Introspection class anymore) eventually. The only remedy so far has been to de-install OOo, run a few different registry cleaners and reboot. Something, which doesn't bode very well (but again: I have not been able to come up with a nutshell example for this behaviour). So what I am doing now is creating a Java class on my own which should contain all the definitions of a UNO class, which are needed at runtime to figure out which field, method of an interface/service contained in a class could be meant by a macro coder; very much like Star Basic or the native Python implementation do. For that class I try to circumvent the Java XIntrospection, because I *think* (I do *not* *know*) , better: I speculate, that that may be be causing troubles. If not, I will get hit anyway and then I hope to be able to come up with a Java-only testcase in a nutshell to demo the behaviour.

Again, thank you and Jürgen very much for your helpful suggestions!

Regards,

---rony

P.S.: Once I come up with a running version of that particular class, I will post it here, so others could take a look at it and maybe evene advantage of it.



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

Reply via email to