T - exact value typepublic abstract class WeakClassCache<T>
extends java.lang.Object
It creates the class specific data in two stages to avoid recursion.
instantiate - creates the data
generate - fills in the details
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.ref.WeakReference<T>>> |
cache
The cache
|
| Constructor and Description |
|---|
WeakClassCache() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
generate(java.lang.Class<?> clazz,
T result)
Fill in the result
|
T |
get(java.lang.Class<?> clazz)
Get the information for a class
|
T |
get(java.lang.String name,
java.lang.ClassLoader cl)
Get the information for a class
|
protected java.util.Map<java.lang.String,java.lang.ref.WeakReference<T>> |
getClassLoaderCache(java.lang.ClassLoader cl)
Get the cache for the classloader
|
protected abstract T |
instantiate(java.lang.Class<?> clazz)
Instantiate for a class
|
protected final java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.ref.WeakReference<T>>> cache
public T get(java.lang.Class<?> clazz)
clazz - the classpublic T get(java.lang.String name, java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException
name - the namecl - the classloaderjava.lang.ClassNotFoundException - when the class cannot be foundprotected abstract T instantiate(java.lang.Class<?> clazz)
clazz - the classprotected abstract void generate(java.lang.Class<?> clazz,
T result)
clazz - the classresult - the resultprotected java.util.Map<java.lang.String,java.lang.ref.WeakReference<T>> getClassLoaderCache(java.lang.ClassLoader cl)
cl - the classloader