net.officefloor.eclipse.classpath
Class ProjectClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by net.officefloor.eclipse.classpath.ProjectClassLoader

public class ProjectClassLoader
extends URLClassLoader

ClassLoader to load classes from a IProject.

Author:
Daniel Sagenschneider

Field Summary
static ClassLoader DEFAULT_CLASS_LOADER
          Default ClassLoader.
 
Method Summary
static ProjectClassLoader create(org.eclipse.ui.IEditorPart editorPart)
          Convenience method to create the ProjectClassLoader from the input IEditorPart.
static ProjectClassLoader create(org.eclipse.core.resources.IProject project)
          Convenience method to create the ProjectClassLoader from an IProject.
static ProjectClassLoader create(org.eclipse.core.resources.IProject project, ClassLoader parentClassLoader)
          Initiates from the IProject with the parent ClassLoader.
static ProjectClassLoader create(String[] classpath, ClassLoader parentClassLoader)
          Initiates from the specified class path.
protected static URL createUrl(String path)
          Creates the URL from the path.
static ConfigurationItem findConfigurationItem(org.eclipse.ui.IEditorPart editorPart, String path)
          Convenience method to find a ConfigurationItem on the class path of the project of the input IEditorPart.
 ConfigurationItem findConfigurationItem(String path)
          Finds the ConfigurationItem.
 ConfigurationContext getConfigurationContext()
          Obtains the ConfigurationContext.
 
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, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CLASS_LOADER

public static final ClassLoader DEFAULT_CLASS_LOADER
Default ClassLoader.

Method Detail

findConfigurationItem

public static ConfigurationItem findConfigurationItem(org.eclipse.ui.IEditorPart editorPart,
                                                      String path)
Convenience method to find a ConfigurationItem on the class path of the project of the input IEditorPart.

Parameters:
editorPart - IEditorPart.
path - Path to ConfigurationItem.
Returns:
ConfigurationItem or null if not found.

create

public static ProjectClassLoader create(org.eclipse.ui.IEditorPart editorPart)
Convenience method to create the ProjectClassLoader from the input IEditorPart.

Parameters:
editorPart - IEditorPart.
Returns:
ProjectClassLoader.

create

public static ProjectClassLoader create(org.eclipse.core.resources.IProject project)
Convenience method to create the ProjectClassLoader from an IProject.

Parameters:
project - IProject.
Returns:
ProjectClassLoader.

create

public static ProjectClassLoader create(org.eclipse.core.resources.IProject project,
                                        ClassLoader parentClassLoader)
Initiates from the IProject with the parent ClassLoader.

Parameters:
project - IProject.
parentClassLoader - Parent ClassLoader.
Returns:
ProjectClassLoader.

create

public static ProjectClassLoader create(String[] classpath,
                                        ClassLoader parentClassLoader)
Initiates from the specified class path.

Parameters:
classpath - Class path.
parentClassLoader - Parent ClassLoader.
Returns:
ProjectClassLoader.

getConfigurationContext

public ConfigurationContext getConfigurationContext()
Obtains the ConfigurationContext.

Returns:
ConfigurationContext.

findConfigurationItem

public ConfigurationItem findConfigurationItem(String path)
Finds the ConfigurationItem.

Parameters:
path - Path of the ConfigurationItem.
Returns:
ConfigurationItem or null if not found.

createUrl

protected static URL createUrl(String path)
Creates the URL from the path.

Parameters:
path - Path to create as a URL.
Returns:
URL of the path or null if fails to create the URL.


Copyright © 2005-2013. All Rights Reserved.