|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.classes.ClassCache
public class ClassCache
Cache for class files being modified. Handles loading and saving of class files. Classes are loaded directly from the file system paths supplied on initialization in preference to the system class path.
Nested Class Summary | |
---|---|
static class |
ClassCache.ClassCacheLocator
Locator using the cache. |
Field Summary | |
---|---|
private java.util.HashMap |
m_classMap
Map from class names to actual class information. |
private java.lang.String[] |
m_paths
Paths to be searched for class files. |
private java.io.File[] |
m_roots
Root directories corresponding to paths. |
private static ClassCache |
s_instance
Singleton instance of class (created when paths set) |
private static java.util.HashSet |
s_preserveClasses
Classes to be preserved without modification. |
Constructor Summary | |
---|---|
private |
ClassCache(java.lang.String[] paths)
Constructor. |
Method Summary | |
---|---|
(package private) static void |
addClassFile(ClassFile cf)
Add created class information to cache. |
static void |
addPreserveClass(java.lang.String name)
Add class name to set to be preserved without modification. |
static ClassFile |
getClassFile(java.lang.String name)
Get class information. |
private ClassFile |
getClassFileImpl(java.lang.String name)
Get class information. |
static java.io.File |
getModifiablePath()
Return the first modifiable directory path from the classpath in use. |
static boolean |
hasClassFile(java.lang.String name)
Check if class information has been loaded. |
static boolean |
isPreserveClass(java.lang.String name)
Check if a class is to be preserved without modification. |
static void |
setPaths(java.lang.String[] paths)
Set class paths to be searched. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static ClassCache s_instance
private static java.util.HashSet s_preserveClasses
private java.lang.String[] m_paths
private java.io.File[] m_roots
private java.util.HashMap m_classMap
Constructor Detail |
---|
private ClassCache(java.lang.String[] paths)
paths
- ordered set of paths to be searched for class filesMethod Detail |
---|
private ClassFile getClassFileImpl(java.lang.String name) throws JiBXException
name
- fully-qualified name of class to be found
null
if class not found
JiBXException
- on any error accessing class filepublic static void addPreserveClass(java.lang.String name)
name
- fully-qualified class namepublic static boolean isPreserveClass(java.lang.String name)
name
- fully-qualified class name
true
if to be preserved, false
if notpublic static ClassFile getClassFile(java.lang.String name) throws JiBXException
name
- fully-qualified name of class to be found
null
if class not found
JiBXException
- on any error accessing class filepublic static boolean hasClassFile(java.lang.String name)
name
- full-qualified name of class to be checked
true
if foundstatic void addClassFile(ClassFile cf)
cf
- information for class to be addedpublic static java.io.File getModifiablePath()
null
if nonepublic static void setPaths(java.lang.String[] paths)
paths
- ordered set of paths to be searched for class files
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |