net.groboclown.util.jplugin.v2
Class ClassCollection

java.lang.Object
  |
  +--net.groboclown.util.jplugin.v2.ClassCollection

public class ClassCollection
extends Object

Maintains all the discovered classes, attributes, and all other data associated with plugins.

Version:
0.9.0 Alpha
Author:
Matt Albrecht

Field Summary
private  Hashtable classNamesToClassWrapper
           
private  FileIdentifiers identifiers
           
 
Constructor Summary
ClassCollection()
          Default constructor
 
Method Summary
 void addClass(ClassWrapper cw)
          Adds a class to the internal collection.
 void addClassAttribute(String className, ClassAttributes ca)
          Add the ClassAttribute to the internal list.
 String[] getClassNames()
          Retrieve the currently known list of class names.
 ClassWrapper getClassWrapper(String name)
          Get the class wrapper for the given class name.
 FileIdentifiers getFileIdentifiers()
           
 void setFileIdentifiers(FileIdentifiers fi)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

identifiers

private FileIdentifiers identifiers

classNamesToClassWrapper

private Hashtable classNamesToClassWrapper
Constructor Detail

ClassCollection

public ClassCollection()
Default constructor
Method Detail

setFileIdentifiers

public void setFileIdentifiers(FileIdentifiers fi)

getFileIdentifiers

public FileIdentifiers getFileIdentifiers()

addClass

public void addClass(ClassWrapper cw)
Adds a class to the internal collection. The wrapper must have a ClassInspector defined (that is, the getClassObject() method must return a non-null value).

Right now, this only allows one class per name, even though Java allows multiple classes with the same name, as long as they have different class loaders.


addClassAttribute

public void addClassAttribute(String className,
                              ClassAttributes ca)
Add the ClassAttribute to the internal list. If the class is already known, then it will inherit these attributes.

getClassNames

public String[] getClassNames()
Retrieve the currently known list of class names. They must have a ClassInspector defined to be included in the list.

getClassWrapper

public ClassWrapper getClassWrapper(String name)
Get the class wrapper for the given class name. The wrapper is only returned if it has a class inspector defined.


Written under the LGPL