org.openoffice.ide.eclipse.core.office
Class OfficeClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.openoffice.ide.eclipse.core.office.OfficeClassLoader

public class OfficeClassLoader
extends java.net.URLClassLoader

Special class loader to use to load OOo related classes. This class loader is important to bootstrap OpenOffice.org.

Author:
cedricbosdo

Method Summary
static OfficeClassLoader getClassLoader(IOOo pOOo, java.lang.ClassLoader pParent)
          Create or load the classloader for the given OpenOffice 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, definePackage, findClass, findResource, findResources, getPermissions, 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, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, 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 OpenOffice instance.

Parameters:
pOOo - the OpenOffice instance to load
pParent - the parent classloader to use if the classloader has to be created.
Returns:
the classloader corresponding to the OpenOffice.org 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.openoffice.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