ter.API.ClassLoader
Class FileClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--ter.API.ClassLoader.GeneralClassLoader
              |
              +--ter.API.ClassLoader.FileClassLoader

public class FileClassLoader
extends GeneralClassLoader

Title: JavInspector

Description: Custom class loader to load classes from file not in the classpath

Copyright: Copyright (c) 2003

Company: Université de Nice Sophia Antipolis (UNSA)

Version:
1.0
Author:
Jerôme GAHIDE - Lucas CHARBIT - Gabriel ZERBIB - Xavier GALBOIS

Constructor Summary
FileClassLoader(java.lang.String classPath)
           
 
Method Summary
 java.lang.String guessClassName(java.lang.String filePath, int i)
          set the classpath and return the name of class from its path in order to load its dependencies
 java.lang.Class loadClass(java.lang.String className, boolean resolveIt)
          an overide of the loadClass method to do try to guess the classpath of the class to load in order to load its depandencies
 void setFilePrefix(java.lang.String str)
          Changes the prefix of the class to load (ex : the classpath or the jar file)
 
Methods inherited from class ter.API.ClassLoader.GeneralClassLoader
loadClass, setClassNameReplacementChar
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileClassLoader

public FileClassLoader(java.lang.String classPath)
Method Detail

loadClass

public java.lang.Class loadClass(java.lang.String className,
                                 boolean resolveIt)
                          throws java.lang.ClassNotFoundException
an overide of the loadClass method to do try to guess the classpath of the class to load in order to load its depandencies

Overrides:
loadClass in class GeneralClassLoader
Parameters:
className - the path of a file or the name of a class
resolveIt - call resolveClass()
Returns:
the loaded class
Throws:
java.lang.ClassNotFoundException

setFilePrefix

public void setFilePrefix(java.lang.String str)
Description copied from class: GeneralClassLoader
Changes the prefix of the class to load (ex : the classpath or the jar file)

Specified by:
setFilePrefix in class GeneralClassLoader
Parameters:
str -

guessClassName

public java.lang.String guessClassName(java.lang.String filePath,
                                       int i)
set the classpath and return the name of class from its path in order to load its dependencies

Parameters:
filePath - the path
i - the number of directories to go up
Returns:
the full name of the class