All Packages Class Hierarchy This Package Previous Next Index
Class espresso.parser.JavaImportManager
java.lang.Object
|
+----espresso.parser.JavaImportManager
- public class JavaImportManager
- extends Object
-
classpath_d
- Vector keeping the directories and zip or jar file paths.
-
DEFAULT_IMPORT
- The name of the default qualified import.
-
JAVA_ROOT
- Root class in Java.
-
loadedClasses_d
- Hashtable to keep track of already loaded class files.
-
notFoundClasses_d
- Hashtable to keep track of class names, that definitely don't
exist as fully qualified names.
-
qualifiedImports_d
- Vector holding all qualified imports.
-
seenClasses_d
- Hashtable to keep track of class names, that exist, and that
are not ambiguous.
-
symbolTable_d
- Reference to the parser's symboltable.
-
JavaImportManager(SymbolTable)
- Constructor taking the parser's symbol table as parameter.
-
addQualifiedImport(String)
- The list of starred imports is maintained by the ImportManager.
-
addQualifiedImport(Symbol)
-
-
cacheLoadedClassName(Symbol)
- Remeber already loaded classes or interfaces
-
cacheNotFoundClassName(Symbol)
- Remember names of classes that were seen unambiguously
-
cacheSeenClassName(Symbol)
- Remember names of classes that were seen unambiguously
-
canonicalize(String)
-
-
classLoaded(Symbol)
- Checks whether fully qualified class represented by trueName
was already loaded
-
classNameSeen(Symbol)
- Checks whether fully qualified class represented by trueName
was found to uniquely exist
-
decanonicalize(String)
-
-
existsClass(String)
- Checks whether fully qualified class represented by
truename exists in directories or zip/jar files defined
in CLASSPATH
-
existsClass(Symbol)
- Convenience method using symbols instead of String
-
fullyQualifyName(String)
- Returns the fully qualified name of simple name provided that such a
class exists in the packages defined by the starred imports (without
ambiguity).
-
fullyQualifyName(Symbol)
-
-
join(Vector, String)
-
-
loadClassHeader(JavaClass, boolean)
- Manages storing of class or Interface data into symbol table
-
loadFields(JavaClass)
- Loads all class fields into symboltable
-
loadHierarchy(TypeDeclarationNode, boolean)
- Manages loading of super classes and interfaces
-
loadMethods(JavaClass)
- Loads all class methods into symboltable
-
notFoundClassName(Symbol)
- Checks whether fully qualified class represented by trueName
was found to uniquely exist
-
printFields(Field[])
-
-
printMethods(Method[])
-
-
readClassFile(Symbol, boolean)
- Manages the loading of class files by initiating
loading of class header information, loading of fields
and loading of methods
Triggers recursive loading for super classes and interfaces
-
setInitializer(VariableDeclaratorNode, ConstantValue)
- Try set the initializer field
-
setUpClassPath()
- Method to break the class path property string apart into distinct
entries representing either directories containing class files, or
path descriptions ending with a zip or a jar file
-
split(String, char)
-
DEFAULT_IMPORT
static final String DEFAULT_IMPORT
- The name of the default qualified import.
JAVA_ROOT
static final String JAVA_ROOT
- Root class in Java.
classpath_d
Vector classpath_d
- Vector keeping the directories and zip or jar file paths.
symbolTable_d
SymbolTable symbolTable_d
- Reference to the parser's symboltable.
loadedClasses_d
Hashtable loadedClasses_d
- Hashtable to keep track of already loaded class files.
seenClasses_d
Hashtable seenClasses_d
- Hashtable to keep track of class names, that exist, and that
are not ambiguous.
notFoundClasses_d
Hashtable notFoundClasses_d
- Hashtable to keep track of class names, that definitely don't
exist as fully qualified names.
qualifiedImports_d
Vector qualifiedImports_d
- Vector holding all qualified imports.
JavaImportManager
public JavaImportManager(SymbolTable symbol)
- Constructor taking the parser's symbol table as parameter. The
symbol table is used by the ImportManager to insert entries of
imported classes and their fields and methods.
setUpClassPath
private void setUpClassPath()
- Method to break the class path property string apart into distinct
entries representing either directories containing class files, or
path descriptions ending with a zip or a jar file
addQualifiedImport
public void addQualifiedImport(String qimport)
- The list of starred imports is maintained by the ImportManager. This
method is used to add an import path to the list of import path to be
used later to satisfy imports on demand.
addQualifiedImport
public void addQualifiedImport(Symbol qimport)
fullyQualifyName
public String fullyQualifyName(String simple) throws Exception
- Returns the fully qualified name of simple name provided that such a
class exists in the packages defined by the starred imports (without
ambiguity).
- Parameters:
- simple - Name respresenting a class or interface.
- Returns:
- The fully qualified name.
fullyQualifyName
public Symbol fullyQualifyName(Symbol simple) throws Exception
classLoaded
private boolean classLoaded(Symbol trueSymbol)
- Checks whether fully qualified class represented by trueName
was already loaded
cacheLoadedClassName
private void cacheLoadedClassName(Symbol trueSymbol)
- Remeber already loaded classes or interfaces
classNameSeen
private boolean classNameSeen(Symbol trueSymbol)
- Checks whether fully qualified class represented by trueName
was found to uniquely exist
cacheSeenClassName
private void cacheSeenClassName(Symbol trueSymbol)
- Remember names of classes that were seen unambiguously
notFoundClassName
private boolean notFoundClassName(Symbol trueSymbol)
- Checks whether fully qualified class represented by trueName
was found to uniquely exist
cacheNotFoundClassName
private void cacheNotFoundClassName(Symbol trueSymbol)
- Remember names of classes that were seen unambiguously
existsClass
public boolean existsClass(Symbol trueSymbol)
- Convenience method using symbols instead of String
existsClass
public boolean existsClass(String trueName)
- Checks whether fully qualified class represented by
truename exists in directories or zip/jar files defined
in CLASSPATH
readClassFile
public boolean readClassFile(Symbol symbol,
boolean loadUpToRoot)
- Manages the loading of class files by initiating
loading of class header information, loading of fields
and loading of methods
Triggers recursive loading for super classes and interfaces
loadHierarchy
private void loadHierarchy(TypeDeclarationNode node,
boolean loadUpToRoot)
- Manages loading of super classes and interfaces
loadClassHeader
private void loadClassHeader(JavaClass jclass,
boolean loadUpToRoot)
- Manages storing of class or Interface data into symbol table
loadFields
private void loadFields(JavaClass jclass)
- Loads all class fields into symboltable
setInitializer
private void setInitializer(VariableDeclaratorNode node,
ConstantValue cons)
- Try set the initializer field
loadMethods
private void loadMethods(JavaClass jclass)
- Loads all class methods into symboltable
printFields
private void printFields(Field fields[])
printMethods
private void printMethods(Method methods[])
join
private String join(Vector v,
String joinString)
split
private Stack split(String s,
char delimiter)
canonicalize
public String canonicalize(String s)
decanonicalize
public String decanonicalize(String s)
All Packages Class Hierarchy This Package Previous Next Index