Login | Register
My pages Projects Community openCollabNet

The Tigris site will receive a major upgrade the evening of Monday, December 1, beginning at 8:30 pm PST. Downtime is projected to be about ten hours. Further details in the announcement


jmt.codebase
Interface CodeBase


public interface CodeBase

Describes the CodeBase type able to read and analyse a class or java source and collecting the analysed classes. It also provides a referencation mechanism for classes/interfaces, methods and fields.

To create a CodeBase instance the CodeBaseFactory.createCodeBase() method must be used. Once a CodeBase instance is created a resource can be added by simply call the CodeBase.add(resource) method.

Author:
Martin Kersten
See Also:
CodeBaseFactory.createCodeBase(), addResource(Resource), AbstractCodeBase

Method Summary
 void addResource(Resource resource)
          Adds a resource to the codebase.
 ClassOrInterface get(ClassName name)
          Returns a ClassOrInterface instance describing the class with the given class name or null if none exsisit within the codebase.
 java.util.Iterator getClasses()
          Returns a Iterator instance for iterating through the classes of the codebase.
 ReferenceManager getReferences()
          Returns the ReferenceManager instance of the CodeBase.
 

Method Detail

addResource

public void addResource(Resource resource)
                 throws java.io.IOException,
                        AnalysationException
Adds a resource to the codebase. The resource will be analysed and the analysed class will be added to the codebase.

Parameters:
resource - The resource to be added
Throws:
java.io.IOException - If an i/o-exception occured.
AnalysationException - If an analysation error occured.

get

public ClassOrInterface get(ClassName name)
Returns a ClassOrInterface instance describing the class with the given class name or null if none exsisit within the codebase.

Parameters:
name - The name of the class or interface
Returns:
ClassOrInterface A ClassOrInterface instance with the given name or null

getClasses

public java.util.Iterator getClasses()
Returns a Iterator instance for iterating through the classes of the codebase.

Returns:
The iterator for iterating through the classes

getReferences

public ReferenceManager getReferences()
Returns the ReferenceManager instance of the CodeBase.

Returns:
The reference manager of the CodeBase