Hi Jürgen,
it seems that the official way of getting all the interfaces there are is only available via an object which possesses the XTypeProvider interface. Does this mean that one could not infer from an UNO class object which interfaces it supplies, but would really need an instance of such a class?
that is right, most of the objects you get over the API are implemented in C++ and you got an proxy object in Java only. So you don't know the class object before you have a real instance of the object. The objects are created dynamically.
But if I have an instance of XIdlClass, wouldn't reflection be able to arrive at the corresponding class and inspect (reflect | introspect) it such, that the UNOIDL defined interfaces and services could be determined by it (thought, that the deprecated method "getInterfaces()" of XIdlClass did do that) ?

E.g. if using
XIdlClass xidl=XIdlReflection.forName("com.sun.star.frame.Desktop");
then the class to inspect is (should be) known?

The same would be true with using an object to get at its type (class) as well:
XIdlClass xidl=XIdlReflection.getType(someObject);
XIdlClass.getName() would in both cases return the fully qualified class name as a string, hence XIdlClass *should* know at least the name of the reflected class and hence be able to inspect it and come up with these important infos.

How "dangerous" would it be to still use the deprecated method "getInterfaces()", really?

Maybe I should ask: what would be the real difference between this deprecated XIdlClass method and using the XTypeProvider interface for an object, if looking at the resulting sequence of Interface types?

---

The motivation: I would like to analyze a UNO class via Java without the mandatory need to instantiate such a class upfront. At the moment I can only come by using a lazy inspection scheme, but that has the consequence that it is not possible to present all of the methods and fields of a given class in all cases, because the methods and fields of interfaces/services cannot be figured out at runtime as long as such a class did not get instantiated. (This seems to restrict the reflectability quite considerably.)

---

I would like to thank you, Daniel and  -mjayant for your kind help!

Regards,

---rony


Reply via email to