com.ca.commons.cbutil
Class CBClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--com.ca.commons.cbutil.CBClassLoader

public class CBClassLoader
extends java.lang.ClassLoader

Title: test Description: See if we can get this crappy IDE to work properly just once. Copyright: Copyright (c) 2001 Company:


Field Summary
protected  java.util.Hashtable classes
          a cached list of classes to speed the return of twice loaded classes.
protected  java.util.Hashtable lowerCaseClasses
           
protected  CBResourceLoader resourceLoader
          The resource loader provides the interface to a group of zip files.
 
Constructor Summary
CBClassLoader(CBResourceLoader loader)
          Constructor - note that that the class is useless until at least one resource file has been registered with it using the addResource() method.
 
Method Summary
 java.lang.Class findClass(java.lang.String className)
          This is a simple version for external clients since they will always want the class resolved before it is returned to them.
 java.lang.Class findClass(java.lang.String className, boolean resolveIt)
          This is the required version of findClass which is called both from findClass above and from the internal function loadClass of the parent.
protected  java.net.URL findResource(java.lang.String name)
          Returns a 'jar url' to the specified resource.
 java.net.URL getResource(java.lang.String name)
           
 java.io.InputStream getResourceAsStream(java.lang.String name)
           
 java.lang.String toString()
           
protected  java.lang.String translateClassName(java.lang.String name)
          Translates the '.' seperators of Class package names into the \ seperators needed for the internal directory structure of the zip file.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, 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, wait, wait, wait
 

Field Detail

classes

protected java.util.Hashtable classes
a cached list of classes to speed the return of twice loaded classes.


lowerCaseClasses

protected java.util.Hashtable lowerCaseClasses

resourceLoader

protected CBResourceLoader resourceLoader
The resource loader provides the interface to a group of zip files.

Constructor Detail

CBClassLoader

public CBClassLoader(CBResourceLoader loader)
Constructor - note that that the class is useless until at least one resource file has been registered with it using the addResource() method.

Method Detail

translateClassName

protected java.lang.String translateClassName(java.lang.String name)
Translates the '.' seperators of Class package names into the \ seperators needed for the internal directory structure of the zip file.


findClass

public java.lang.Class findClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
This is a simple version for external clients since they will always want the class resolved before it is returned to them.

Overrides:
findClass in class java.lang.ClassLoader
java.lang.ClassNotFoundException

findClass

public java.lang.Class findClass(java.lang.String className,
                                 boolean resolveIt)
                          throws java.lang.ClassNotFoundException
This is the required version of findClass which is called both from findClass above and from the internal function loadClass of the parent.

java.lang.ClassNotFoundException

getResource

public java.net.URL getResource(java.lang.String name)
Overrides:
getResource in class java.lang.ClassLoader

findResource

protected java.net.URL findResource(java.lang.String name)
Returns a 'jar url' to the specified resource.

Overrides:
findResource in class java.lang.ClassLoader
Parameters:
name - the name of the resource to look for (e.g. 'HelpSet.hs')
Returns:
the url of the resource, (e.g. 'jar:file:myjarfile.jar!/HelpSet.hs'. - this will be null if the resource cannot be found in the known jar file.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
Overrides:
getResourceAsStream in class java.lang.ClassLoader