OO-Snippets: Simple wrapper for uno-services

Commons

Keywordswrapper, UnoRuntime.queryInterface, queryInterface, inspect, inspection, methods, interfaces, property, properties, services, object, convenience, class, information
LanguageJava
ApplicationOffice
AuthorsChristoph Lutz (initial)
Supported Versions1.1.x  
Supported OSAll  
QuestionIs there a way to avoid all the UnoRuntime.queryInterface-calls

Programming in Java is very uncomfortable. The Java-program is nearly unreadable cause of the many temporary variables you need to hold interface-instances.

also uno-services are not very transparent. How do I get the names of the provided services, interfaces, properties and methods?

Answer

use a wrapperclass to let the wrapper perform the queryInterface-calls. This is my wrapper class - simple but effective.

It also provides method for a runtime-inspection similar to the famous XRay-tool.

Code-Snippet-Listing (snippet-source)

t

Changelog

DateUserModification
2005-06-12CLInitial version

and