Hi Christian,

Christian Junker wrote:
First of all XIntrospectionAccess does not support the method .inspect(...), it is css :: beans :: XIntrospection. XIntrospectionAccess is the type of the *returned* object instead.

Sorry, I *mistyped* the class name it should have been "XIntrospection.inspect(someObject)" which indeed returnx a XIntrospectionAccess object (that's what I am interested in, needless to say).

So "my" reported error occurs with (now typed):
import com.sun.star.beans.*;
XIntrospectionAccess o=(XIntrospectionAccess) XIntrospection.inspect(someObject) ;
I hope you also know about the queryInterface concept, if not -> have a look at the Developer's Guide. Its' about safe type casting of objects, which I don't see in that one line of code you provide.
Yes, I know of these concepts and have studied chapter "5 Advanced UNO" in the Developer's Guide (p. 301 through 239; that's where I got the information about the interface "XIntrospection" and the method "inspect(someObject)". Also studied the online references to the various reflection/introspection classes.

My problem is that I am not using C++ but Java and have found no nutshell-programs/hints/faq with reflecting/introspecting UNO components via "Java-UNO".

Any working Java-snippet would help me a lot, needless to say. (I am trying to get at the methods and properties of any UNO object at runtime using reflection/introspection via Java.)

TIA,

---rony

2005/7/13, Rony G. Flatscher <[EMAIL PROTECTED]>:
Hi there,

just a question using introspection via Java: if using

o=com.sun.star.beans.XIntrospectionAccess.inspect(someObject);
on OOo 1.1.4 I receive "method invocation failed:
java.lang.IllegalArgumentException: object is not an
instance of declaring class".

Is there something special I need to do/to know before using introspection
via Java?

TIA,

---rony

Reply via email to