public class BytecodeTypeInfoFactoryImpl extends org.jboss.util.collection.WeakClassCache<TypeInfo> implements TypeInfoFactory, AnnotationHelper
Modifier and Type | Class and Description |
---|---|
protected static class |
BytecodeTypeInfoFactoryImpl.ModifiableArrayType
Wrapper around
SignatureAttribute.ArrayType to make it easier to
create the name used to look up the array type infos
in the cache |
Constructor and Description |
---|
BytecodeTypeInfoFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
AnnotationValue |
createAnnotationValue(AnnotationInfo info,
Object ann)
Create an annotation from the underlying implementation and its info type
|
protected TypeInfo |
createTypeInfoForTypeArgument(javassist.bytecode.SignatureAttribute.TypeArgument arg,
ClassLoader loader,
org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
Gets the type info for a javassist type argument
|
protected void |
generate(Class clazz,
TypeInfo result) |
TypeInfo |
get(Class clazz)
Get the information for a class
|
protected TypeInfo |
get(ClassBytes classBytes,
Class<?> clazz,
String name,
ClassLoader cl,
boolean delegateToReflectIfNotFound)
Get the information for a class
|
TypeInfo |
get(String name,
ClassLoader cl)
Get the information for a class
|
protected TypeInfo |
get(String name,
ClassLoader cl,
Class<?> clazz)
Get the information for a class
|
AnnotationValue[] |
getAnnotations(Object obj)
Get the annotations for the annotated object
|
protected Map<String,WeakReference<TypeInfo>> |
getClassLoaderCache(ClassLoader cl)
Gets the classloader cache for the passed in classloader.
|
ClassLoaderFinder |
getClassLoaderFinder() |
protected ArrayInfo |
getGenericArrayType(ClassLoader cl,
BytecodeTypeInfoFactoryImpl.ModifiableArrayType type,
org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
Recursively get the type info for a javassist array type
|
protected ArrayInfo |
getGenericArrayType(ClassLoader cl,
javassist.bytecode.SignatureAttribute.ArrayType type,
org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
Get the type info for a javassist array type
|
protected TypeInfo |
getGenericArrayType(GenericArrayType type)
Get the type info for a reflect generic array type
|
protected TypeInfo |
getParameterizedType(ParameterizedType type)
Creates a type info from a reflect generic paramemeterized type
|
TypeInfo |
getTypeInfo(Class<?> clazz)
Get a type info
|
protected TypeInfo |
getTypeInfo(ClassLoader loader,
javassist.bytecode.SignatureAttribute.ClassType type,
org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
Gets the type info for a javassist generic class type
|
protected TypeInfo |
getTypeInfo(ClassLoader loader,
javassist.bytecode.SignatureAttribute.Type type,
org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
Gets the type info for a javassist type
|
TypeInfo |
getTypeInfo(String name,
ClassLoader cl)
Gets the type info for a class
|
TypeInfo |
getTypeInfo(Type type)
Gets the type info for a reflect type
|
protected TypeInfo |
getTypeVariable(TypeVariable<?> type)
Get the type info for a reflect TypeVariable
|
protected TypeInfo |
getWildcardType(WildcardType type)
Gets the type info for a reflect wildcard type
|
protected TypeInfo |
instantiate(Class clazz) |
protected TypeInfo |
instantiate(String name,
ClassBytes classBytes,
Class<?> clazz) |
void |
setClassLoaderFinder(ClassLoaderFinder finder) |
public ClassLoaderFinder getClassLoaderFinder()
public void setClassLoaderFinder(ClassLoaderFinder finder)
protected TypeInfo instantiate(Class clazz)
instantiate
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
protected TypeInfo instantiate(String name, ClassBytes classBytes, Class<?> clazz)
protected void generate(Class clazz, TypeInfo result)
generate
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
public TypeInfo getTypeInfo(Class<?> clazz)
TypeInfoFactory
getTypeInfo
in interface TypeInfoFactory
clazz
- the classpublic TypeInfo getTypeInfo(String name, ClassLoader cl) throws ClassNotFoundException
getTypeInfo
in interface TypeInfoFactory
type
- the typeClassNotFoundException
- when there is no such classpublic TypeInfo getTypeInfo(Type type)
getTypeInfo
in interface TypeInfoFactory
type
- the typepublic TypeInfo get(String name, ClassLoader cl) throws ClassNotFoundException
get
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
name
- the namecl
- the classloaderClassNotFoundException
- when the class cannot be foundpublic TypeInfo get(Class clazz)
get
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
clazz
- the classprotected TypeInfo get(String name, ClassLoader cl, Class<?> clazz) throws ClassNotFoundException
name
- the namecl
- the classloaderclazz
- the classClassNotFoundException
- when the class cannot be foundprotected TypeInfo get(ClassBytes classBytes, Class<?> clazz, String name, ClassLoader cl, boolean delegateToReflectIfNotFound) throws ClassNotFoundException
classBytes
- the class bytes, may be nullclazz
- the class, may be nullname
- the name of the classcl
- the class loader initiating the lookupIllegalArgumentException
- if either name or cl are nullClassNotFoundException
public AnnotationValue[] getAnnotations(Object obj)
AnnotationHelper
getAnnotations
in interface AnnotationHelper
obj
- the annotated objectpublic AnnotationValue createAnnotationValue(AnnotationInfo info, Object ann)
AnnotationHelper
createAnnotationValue
in interface AnnotationHelper
info
- the annotation infoann
- the underlying annotationprotected TypeInfo getParameterizedType(ParameterizedType type)
type
- the parameterized typeprotected TypeInfo getTypeInfo(ClassLoader loader, javassist.bytecode.SignatureAttribute.Type type, org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
loader
- the class loadertype
- the class typespy
- used to determine actual types of type variablesprotected TypeInfo getTypeInfo(ClassLoader loader, javassist.bytecode.SignatureAttribute.ClassType type, org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
loader
- the class loader of the raw classparameterloaders
- the class of thetype
- the class typespy
- used to determine actual types of type variablesprotected TypeInfo createTypeInfoForTypeArgument(javassist.bytecode.SignatureAttribute.TypeArgument arg, ClassLoader loader, org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
arg
- the type argumentloader
- the class loaderspy
- used to determine actual types of type variablesprotected TypeInfo getWildcardType(WildcardType type)
type
- the wildcard typeprotected Map<String,WeakReference<TypeInfo>> getClassLoaderCache(ClassLoader cl)
getClassLoaderCache
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
cl
- the classloader. If null is used, the Thread context classloader will be used insteadprotected TypeInfo getGenericArrayType(GenericArrayType type)
type
- the array typeprotected ArrayInfo getGenericArrayType(ClassLoader cl, javassist.bytecode.SignatureAttribute.ArrayType type, org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
cl
- the classloadertype
- the array typespy
- used to determine actual types of type variablesprotected ArrayInfo getGenericArrayType(ClassLoader cl, BytecodeTypeInfoFactoryImpl.ModifiableArrayType type, org.jboss.reflect.plugins.bytecode.BytecodeTypeVariableSpy spy)
cl
- the classloadertype
- the array typespy
- used to determine actual types of type variablesprotected TypeInfo getTypeVariable(TypeVariable<?> type)
type
- the type variableCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.