Class OfficeClassLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static OfficeClassLoader getClassLoader​(IOOo pOOo, java.lang.ClassLoader pParent)
      Create or load the classloader for the given LibreOffice instance.
      protected java.lang.Class<?> loadClass​(java.lang.String pName, boolean pResolve)
      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.
      • Methods inherited from class java.net.URLClassLoader

        addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
      • Methods inherited from class java.security.SecureClassLoader

        defineClass, defineClass
      • Methods inherited from class java.lang.ClassLoader

        clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getClassLoader

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

        protected java.lang.Class<?> loadClass​(java.lang.String pName,
                                               boolean pResolve)
                                        throws java.lang.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 java.lang.ClassLoader
        Parameters:
        pName - the name of the class to load
        pResolve - if true then resolves the class
        Returns:
        the loaded class
        Throws:
        java.lang.ClassNotFoundException - if the class cannot be found