public abstract class Repository extends Object
Repository
,
SyntheticRepository
Constructor and Description |
---|
Repository() |
Modifier and Type | Method and Description |
---|---|
static JavaClass |
addClass(JavaClass clazz)
Adds clazz to repository if there isn't an equally named class already in there.
|
static void |
clearCache()
Clears the repository.
|
static JavaClass[] |
getInterfaces(JavaClass clazz) |
static JavaClass[] |
getInterfaces(String className) |
static Repository |
getRepository() |
static JavaClass[] |
getSuperClasses(JavaClass clazz) |
static JavaClass[] |
getSuperClasses(String className) |
static boolean |
implementationOf(JavaClass clazz,
JavaClass inter) |
static boolean |
implementationOf(JavaClass clazz,
String inter) |
static boolean |
implementationOf(String clazz,
JavaClass inter) |
static boolean |
implementationOf(String clazz,
String inter) |
static boolean |
instanceOf(JavaClass clazz,
JavaClass superclass)
Equivalent to runtime "instanceof" operator.
|
static boolean |
instanceOf(JavaClass clazz,
String superclass) |
static boolean |
instanceOf(String clazz,
JavaClass superclass) |
static boolean |
instanceOf(String clazz,
String superclass) |
static JavaClass |
lookupClass(Class<?> clazz)
Tries to find class source using the internal repository instance.
|
static JavaClass |
lookupClass(String className)
Lookups class somewhere found on your CLASSPATH, or whereever the repository instance looks for it.
|
static ClassPath.ClassFile |
lookupClassFile(String className) |
static void |
removeClass(JavaClass clazz)
Removes given class from repository.
|
static void |
removeClass(String clazz)
Removes class with given (fully qualified) name from repository.
|
static void |
setRepository(Repository rep)
Sets repository instance to be used for class loading
|
public Repository()
public static JavaClass addClass(JavaClass clazz)
public static void clearCache()
public static JavaClass[] getInterfaces(JavaClass clazz) throws ClassNotFoundException
ClassNotFoundException
- if any of the class's superclasses or superinterfaces can't be foundpublic static JavaClass[] getInterfaces(String className) throws ClassNotFoundException
ClassNotFoundException
- if the named class can't be found, or if any of its superclasses or superinterfaces
can't be foundpublic static Repository getRepository()
public static JavaClass[] getSuperClasses(JavaClass clazz) throws ClassNotFoundException
ClassNotFoundException
- if any of the superclasses can't be foundpublic static JavaClass[] getSuperClasses(String className) throws ClassNotFoundException
ClassNotFoundException
- if the named class or any of its superclasses can't be foundpublic static boolean implementationOf(JavaClass clazz, JavaClass inter) throws ClassNotFoundException
ClassNotFoundException
- if any superclasses or superinterfaces of clazz can't be foundpublic static boolean implementationOf(JavaClass clazz, String inter) throws ClassNotFoundException
ClassNotFoundException
- if inter or any superclasses or superinterfaces of clazz can't be foundpublic static boolean implementationOf(String clazz, JavaClass inter) throws ClassNotFoundException
ClassNotFoundException
- if clazz or any superclasses or superinterfaces of clazz can't be foundpublic static boolean implementationOf(String clazz, String inter) throws ClassNotFoundException
ClassNotFoundException
- if clazz, inter, or any superclasses or superinterfaces of clazz can't be foundpublic static boolean instanceOf(JavaClass clazz, JavaClass superclass) throws ClassNotFoundException
ClassNotFoundException
- if any superclasses or superinterfaces of clazz can't be foundpublic static boolean instanceOf(JavaClass clazz, String superclass) throws ClassNotFoundException
ClassNotFoundException
- if superclass can't be foundpublic static boolean instanceOf(String clazz, JavaClass superclass) throws ClassNotFoundException
ClassNotFoundException
- if clazz can't be foundpublic static boolean instanceOf(String clazz, String superclass) throws ClassNotFoundException
ClassNotFoundException
- if either clazz or superclass can't be foundpublic static JavaClass lookupClass(Class<?> clazz) throws ClassNotFoundException
ClassNotFoundException
- if the class could not be found or parsed correctlyClass
public static JavaClass lookupClass(String className) throws ClassNotFoundException
ClassNotFoundException
- if the class could not be found or parsed correctlypublic static ClassPath.ClassFile lookupClassFile(String className)
public static void removeClass(JavaClass clazz)
public static void removeClass(String clazz)
public static void setRepository(Repository rep)
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.