Class OfficeClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.libreoffice.ide.eclipse.core.office.OfficeClassLoader
All Implemented Interfaces:
Closeable, AutoCloseable

public class OfficeClassLoader extends URLClassLoader
Special class loader to use to load OOo related classes. This class loader is important to bootstrap LibreOffice.
  • Method Details

    • getClassLoader

      public static OfficeClassLoader getClassLoader(IOOo ooo, ClassLoader parent)
      Create or load the classloader for the given LibreOffice instance.
      Parameters:
      ooo - the LibreOffice instance to load
      parent - the parent classloader to use if the classloader has to be created.
      Returns:
      the classloader corresponding to the LibreOffice instance
    • loadClass

      protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
      Load a class in a different order than the standard one: first look in the URLs then call the parent's class loader loadClass method. This order is applied only if the class to load is in the org.libreoffice.ide.eclipse.core.internal.office package.
      Overrides:
      loadClass in class ClassLoader
      Parameters:
      name - the name of the class to load
      resolve - if true then resolves the class
      Returns:
      the loaded class
      Throws:
      ClassNotFoundException - if the class cannot be found