T
- the cached typepublic abstract class WeakTypeCache<T> extends Object
It creates the class specific data in two stages to avoid recursion.
instantiate - creates the data
generate - fills in the details
Constructor and Description |
---|
WeakTypeCache() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
generate(Class<?> clazz,
T result)
Fill in the result
|
protected abstract void |
generate(ParameterizedType type,
T result)
Fill in the result
|
T |
get(String name,
ClassLoader cl)
Get the information for a class
|
T |
get(Type type)
Get the information for a type
|
protected T |
getClass(Class<?> clazz)
Get the information for a class
|
protected Map<String,T> |
getClassLoaderCache(ClassLoader cl)
Get the cache for the classloader
|
protected T |
getGenericArrayType(GenericArrayType type)
Get the information for an array type
|
protected T |
getParameterizedType(ParameterizedType type)
Get the information for a parameterized type
|
protected <D extends GenericDeclaration> |
getTypeVariable(TypeVariable<D> type)
Get the information for a type variable
|
protected T |
getWildcardType(WildcardType type)
Get the information for a wildcard type
|
protected abstract T |
instantiate(Class<?> clazz)
Instantiate for a class
|
protected abstract T |
instantiate(ParameterizedType type)
Instantiate for a parameterized type
|
protected T |
peek(Class<?> clazz)
Peek into the cache
|
protected T |
peek(ParameterizedType type)
Peek into the cache
|
protected void |
put(Class<?> clazz,
T result)
Put a result into the cache
|
protected void |
put(ParameterizedType type,
T result)
Put a result into the cache
|
public T get(Type type)
type
- the typepublic T get(String name, ClassLoader cl) throws ClassNotFoundException
name
- the namecl
- the classloaderClassNotFoundException
- when the class cannot be foundprotected abstract T instantiate(Class<?> clazz)
clazz
- the classprotected abstract void generate(Class<?> clazz, T result)
clazz
- the classresult
- the resultprotected abstract T instantiate(ParameterizedType type)
type
- the parameterized typeprotected abstract void generate(ParameterizedType type, T result)
type
- the parameterized typeresult
- the resultprotected T getParameterizedType(ParameterizedType type)
type
- the parameterized typeprotected T getWildcardType(WildcardType type)
type
- the paremeterized typeprotected <D extends GenericDeclaration> T getTypeVariable(TypeVariable<D> type)
D
- the declarationtype
- the type variableprotected T getGenericArrayType(GenericArrayType type)
type
- the array typeprotected T peek(ParameterizedType type)
type
- the typeprotected void put(ParameterizedType type, T result)
type
- the typeresult
- the valueprotected T getClass(Class<?> clazz)
clazz
- the classprotected T peek(Class<?> clazz)
clazz
- the classprotected void put(Class<?> clazz, T result)
clazz
- the classresult
- the valueprotected Map<String,T> getClassLoaderCache(ClassLoader cl)
cl
- the classloaderCopyright © 2018 JBoss by Red Hat. All rights reserved.