Class OfficeClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- org.libreoffice.ide.eclipse.core.office.OfficeClassLoader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class OfficeClassLoader extends java.net.URLClassLoaderSpecial 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 OfficeClassLoadergetClassLoader(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.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
-
-
-
-
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 loadpParent- 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.ClassNotFoundExceptionLoad 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 theorg.libreoffice.ide.eclipse.core.internal.officepackage.- Overrides:
loadClassin classjava.lang.ClassLoader- Parameters:
pName- the name of the class to loadpResolve- iftruethen resolves the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException- if the class cannot be found
-
-