Uno/Article/Types&Reflection

From Apache OpenOffice Wiki
< Uno
Jump to: navigation, search

Uno provides several ways to access, get and deal with types of objects and values.

com.sun.star.refelction.CoreReflection
Gives access to the methods etc. of the passed type name, respectively methods etc. of the exact type of the passed object. Methods, attributes etc. can be "called" directly. The CoreReflection is only available for Binary Uno, e.g. there is no such service for pure Java Uno.
com.sun.star.beans.Introspection
Gives access to all methods and interfaces of the passed object as an integrated entity. The Introspection relies on the CoreReflection and on the object to implement the XTypeProvider interface. E.g. in contrast to the CoreReflection, Introspection unifies property and attribute information.
com.sun.star.scrip.Invocation
A service for dynamically invoking a method of a particular object. This service was designed for scripting languages connection to Uno. It also takes care of needed type conversions (with the help of the script.Converter service) etc. The Invocation relies on the CoreReflection.
com.sun.star.reflection.TypeDescriptionProvider / com.sun.star.reflection.TypeDescriptionManager
Services providing access to type descriptions. The TypeDescriptionManager just delegates requests to the registered providers. The returned type descriptions are different of what the CoreReflection provides and are for informational purposes only. E.g. the remote bridges use these type descriptions. Additionally, the TypeDescriptionManager caches typedescription objects and the TypeDescriptionManager is the only source that reflects all Uno IDL (Interface Definition Language) information with the exception of documentation.
The current TypeDescriptionManager is available as a singleton "/singletons/com.sun.star.reflection.theTypeDescriptionManager" by querying the ComponentContext.
com.sun.star.lang.XTypeProvider
An to be implemented interface providing all interfaces of an object, the Introspection and OOo BASIC rely on objects to implement this interface.
com.sun.star.lang.XServiceInfo
An interface providing the implementation name and the supported services of an object. This was/is needed for objects not implemented using the new multiple inheritance stuff.

See also

Personal tools