Navigation



JATLOM - JAva Type Library Object Model

JATLOM is what SWTtoCOM uses to read and interpret the contents of a type library. It consists of a very flat Java object graph that closely replicates the object model of a type library. It also consists of a native C DLL that reads the type library utilising the type library api and populates the Java objects with the contents of the type library. JATLOM also provides some extensions to the type library object model in order to implement some extended features in SWTtoCOM. An example of this is the ability to interogate imported type libraries via JATLOM. The type library api does not provide any functions to directly do this, however the JATLOM api has abstracted this information to make it much easier to deal with in Java.

Using JATLOM

JATLOM was written specifically with SWTtoCOM in mind however there is no reason why you couldn't write a Java application that utilises JATLOM directly to interogate the contents of a type library. Using the JATLOM api is very easy. Just use one of the static load methods on the ITypeLib class to load a type library and your off and running. The following example code loads the word type library.

ITypeLib typeLib;
TypeLibAttributes attr;
typeLib = ITypeLib.loadTypeLib("MSWORD.OLB");
attr = typeLib.getTypeLibAttributes();
System.out.println("Loaded: " + attr.getName());
System.out.println("GUID: " + attr.getGUID());
System.out.println("Version: "+ attr.getMajorVersion()
                              + "." 
                              + attr.getMinorVersion());
System.out.println("Desc: " + attr.getDescription());
System.out.println("Path: " + attr.getTypeLibraryFilePath());