public class SyntheticRepository extends Object implements Repository
Repository,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
private static Map |
_instances |
private Map |
_loadedClasses |
private ClassPath |
_path |
private static String |
DEFAULT_PATH |
| Modifier | Constructor and Description |
|---|---|
private |
SyntheticRepository(ClassPath path) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all entries from cache.
|
JavaClass |
findClass(String className)
Find an already defined (cached) JavaClass object by name.
|
ClassPath |
getClassPath()
ClassPath associated with the Repository.
|
static SyntheticRepository |
getInstance() |
static SyntheticRepository |
getInstance(ClassPath classPath) |
JavaClass |
loadClass(Class clazz)
Find the JavaClass object for a runtime Class object.
|
private JavaClass |
loadClass(InputStream is,
String className) |
JavaClass |
loadClass(String className)
Find a JavaClass object by name.
|
void |
removeClass(JavaClass clazz)
Remove class from repository
|
void |
storeClass(JavaClass clazz)
Store a new JavaClass instance into this Repository.
|
private static final String DEFAULT_PATH
private static Map _instances
private ClassPath _path
private Map _loadedClasses
private SyntheticRepository(ClassPath path)
public static SyntheticRepository getInstance()
public static SyntheticRepository getInstance(ClassPath classPath)
public void storeClass(JavaClass clazz)
storeClass in interface Repositorypublic void removeClass(JavaClass clazz)
removeClass in interface Repositorypublic JavaClass findClass(String className)
findClass in interface Repositorypublic JavaClass loadClass(String className) throws ClassNotFoundException
loadClass in interface RepositoryclassName - the name of the classClassNotFoundException - if the class is not in the
Repository, and could not be found on the classpathpublic JavaClass loadClass(Class clazz) throws ClassNotFoundException
loadClass in interface Repositoryclazz - the runtime Class objectClassNotFoundException - if the class is not in the
Repository, and its representation could not be foundClassprivate JavaClass loadClass(InputStream is, String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic ClassPath getClassPath()
getClassPath in interface Repositorypublic void clear()
clear in interface Repository