sleep.parser

Class ImportManager

public class ImportManager extends Object

This class mantains a cache of imported package names and resolve classes for a Sleep parser. The existence of this class also allows these imports to be shared between parser instances. Value is allowing dynamically parsed code like eval, expr, compile_clousre etc.. to inherit their parents imported class information.
Field Summary
protected HashMapclasses
protected Mapimports
protected HashMapjars
Method Summary
ClassfindImportedClass(String name)
Attempts to find a class, starts out with the passed in string itself, if that doesn't resolve then the string is appended to each imported package to see where the class might exist
voidimportPackage(String packagez, String from)
Used by Sleep to import statement to save an imported package name.

Field Detail

classes

protected HashMap classes

imports

protected Map imports

jars

protected HashMap jars

Method Detail

findImportedClass

public Class findImportedClass(String name)
Attempts to find a class, starts out with the passed in string itself, if that doesn't resolve then the string is appended to each imported package to see where the class might exist

importPackage

public void importPackage(String packagez, String from)
Used by Sleep to import statement to save an imported package name.