org.eclipse.viatra.query.patternlanguage.emf.ui.util

## Class JavaProjectClassLoaderProvider

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.emf.util.SimpleClassLoaderProvider
  - - org.eclipse.viatra.query.patternlanguage.emf.ui.util.JavaProjectClassLoaderProvider

- All Implemented Interfaces:
    IWorkspaceUtilities, IClassLoaderProvider

      public class JavaProjectClassLoaderProvider
      extends SimpleClassLoaderProvider
      implements IWorkspaceUtilities

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaProjectClassLoaderProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.ClassLoader` | `getClassLoader(org.eclipse.core.resources.IFile file)` Returns a `ClassLoader` that is capable of loading classes defined in the project of the input file, or in any dependencies of that project.
    `java.lang.ClassLoader` | `getClassLoader(Pattern pattern)` Finds the class loader usable for interpreting expressions defined inside the pattern.
    `org.eclipse.core.resources.IFile` | `getIFile(Pattern pattern)` Returns the containing IFile, if the pattern has a valid resource.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaProjectClassLoaderProvider

          public JavaProjectClassLoaderProvider()

  - ### Method Detail

    - #### getClassLoader

          public java.lang.ClassLoader getClassLoader(Pattern pattern)
                                               throws ViatraQueryException

      Description copied from interface: `IClassLoaderProvider`
      Finds the class loader usable for interpreting expressions defined inside the pattern.
      Specified by:
        `getClassLoader` in interface `IClassLoaderProvider`
      Overrides:
        `getClassLoader` in class `SimpleClassLoaderProvider`
      Returns:
        the found classloader, never null
      Throws:
        `ViatraQueryException` - if no classloader is found, or classloader cannot be initialized, an exception is thrown

    - #### getIFile

          public org.eclipse.core.resources.IFile getIFile(Pattern pattern)

      Description copied from interface: `IWorkspaceUtilities`
      Returns the containing IFile, if the pattern has a valid resource.
      Specified by:
        `getIFile` in interface `IWorkspaceUtilities`
      Parameters:
        `pattern` - `Pattern`
      Returns:
        `IFile`

    - #### getClassLoader

          public java.lang.ClassLoader getClassLoader(org.eclipse.core.resources.IFile file)
                                               throws org.eclipse.core.runtime.CoreException,
                                                      java.net.MalformedURLException

      Returns a `ClassLoader` that is capable of loading classes defined in the project of the input file, or in any dependencies of that project.
      Parameters:
        `file` -
      Returns:
        `ClassLoader`
      Throws:
        `org.eclipse.core.runtime.CoreException`
        `java.net.MalformedURLException`