|
JBoss Reflection 2.2.1.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.collection.WeakClassCache<TypeInfo>
org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl
public class JavassistTypeInfoFactoryImpl
A javassist type factory. TODO: need to fix the cl stuff
Nested Class Summary | |
---|---|
protected static class |
JavassistTypeInfoFactoryImpl.ModifiableArrayType
Wrapper around SignatureAttribute.ArrayType to make it easier to
create the name used to look up the array type infos
in the cache |
Field Summary |
---|
Fields inherited from class org.jboss.util.collection.WeakClassCache |
---|
cache |
Method Summary | |
---|---|
protected static String |
convertName(javassist.CtClass clazz)
Convert name |
AnnotationValue |
createAnnotationValue(AnnotationInfo info,
Object ann)
Create an annotation from the underlying implementation and its info type |
MutableClassInfo |
createNewMutableClass(String name)
Creates a new MutableClass. |
MutableClassInfo |
createNewMutableClass(String name,
ClassInfo superClass)
Creates a new MutableClass. |
MutableClassInfo |
createNewMutableInterface(String name)
Creates a new mutable interface. |
MutableClassInfo |
createNewMutableInterface(String name,
ClassInfo superClass)
Creates a new mutable interface. |
protected TypeInfo |
createTypeInfoForTypeArgument(javassist.bytecode.SignatureAttribute.TypeArgument arg,
ClassLoader loader,
org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy 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(javassist.CtClass ctClass)
Get the information for a class |
protected TypeInfo |
get(javassist.CtClass ctClass,
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. |
protected javassist.CtClass |
getCtClass(String name)
Gets the CtClass corresponding to name by using the bootstrap class pool. |
protected javassist.CtClass |
getCtClass(String name,
ClassLoader classLoader)
Gets the CtClass corresponding to name . |
protected ArrayInfo |
getGenericArrayType(ClassLoader cl,
JavassistTypeInfoFactoryImpl.ModifiableArrayType type,
org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy 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.javassist.JavassistTypeVariableSpy 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 |
MutableClassInfo |
getMutable(String name,
ClassLoader cl)
Gets the information for a MutableClass. |
protected TypeInfo |
getParameterizedType(ParameterizedType type)
Creates a type info from a reflect generic paramemeterized type |
static ClassPoolFactory |
getPoolFactory()
|
TypeInfo |
getTypeInfo(Class<?> clazz)
Get a type info |
protected TypeInfo |
getTypeInfo(ClassLoader loader,
javassist.bytecode.SignatureAttribute.ClassType type,
org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy 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.javassist.JavassistTypeVariableSpy spy)
Gets the type info for a javassist type |
protected TypeInfo |
getTypeInfo(javassist.CtClass ctClass)
Get the type info |
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(javassist.CtClass ctClass,
Class<?> clazz)
|
static NoClassDefFoundError |
raiseClassNotFound(String name,
ClassNotFoundException e)
Raise NoClassDefFoundError for javassist not found |
static NoClassDefFoundError |
raiseClassNotFound(String name,
javassist.NotFoundException e)
Raise NoClassDefFoundError for javassist not found |
static NoClassDefFoundError |
raiseFieldNotFound(String name,
javassist.NotFoundException e)
Raise NoClassDefFoundError for javassist not found |
static NoClassDefFoundError |
raiseMethodNotFound(String name,
javassist.NotFoundException e)
Raise NoClassDefFoundError for javassist not found |
static void |
setPoolFactory(ClassPoolFactory classPoolFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ClassPoolFactory getPoolFactory()
public static void setPoolFactory(ClassPoolFactory classPoolFactory)
public static NoClassDefFoundError raiseClassNotFound(String name, javassist.NotFoundException e) throws NoClassDefFoundError
name
- the namee
- the not found error
NoClassDefFoundError
- alwayspublic static NoClassDefFoundError raiseClassNotFound(String name, ClassNotFoundException e) throws NoClassDefFoundError
name
- the namee
- the not found error
NoClassDefFoundError
- alwayspublic static NoClassDefFoundError raiseMethodNotFound(String name, javassist.NotFoundException e) throws NoClassDefFoundError
name
- the namee
- the not found error
NoClassDefFoundError
- alwayspublic static NoClassDefFoundError raiseFieldNotFound(String name, javassist.NotFoundException e) throws NoClassDefFoundError
name
- the namee
- the not found error
NoClassDefFoundError
- alwaysprotected TypeInfo instantiate(Class clazz)
instantiate
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
protected TypeInfo instantiate(javassist.CtClass ctClass, Class<?> clazz)
protected TypeInfo getTypeInfo(javassist.CtClass ctClass)
ctClass
- the ctClass
protected static String convertName(javassist.CtClass clazz)
clazz
- the class
protected javassist.CtClass getCtClass(String name, ClassLoader classLoader)
name
.
name
- the name of the CtClass to be retrievedclassLoader
- the classLoader that loaded the corresponding Class> object
protected javassist.CtClass getCtClass(String name)
name
by using the bootstrap class pool.
name
- the name of the CtClass to be retrieved
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 class
public TypeInfo getTypeInfo(String name, ClassLoader cl) throws ClassNotFoundException
getTypeInfo
in interface TypeInfoFactory
name
- the typecl
- the classloader
ClassNotFoundException
- when there is no such classpublic TypeInfo getTypeInfo(Type type)
getTypeInfo
in interface TypeInfoFactory
type
- the type
public TypeInfo get(String name, ClassLoader cl) throws ClassNotFoundException
get
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
name
- the namecl
- the classloader
ClassNotFoundException
- when the class cannot be foundpublic TypeInfo get(Class clazz)
get
in class org.jboss.util.collection.WeakClassCache<TypeInfo>
clazz
- the class
protected TypeInfo get(String name, ClassLoader cl, Class<?> clazz) throws ClassNotFoundException
name
- the namecl
- the classloaderclazz
- the class
ClassNotFoundException
- when the class cannot be foundprotected TypeInfo get(javassist.CtClass ctClass)
ctClass
- the class
protected TypeInfo get(javassist.CtClass ctClass, Class<?> clazz, String name, ClassLoader cl, boolean delegateToReflectIfNotFound) throws ClassNotFoundException
ctClass
- the class, may be nullclazz
- the class, may be nullname
- the name of the classcl
- the class loader
IllegalArgumentException
- if either name or cl are null
ClassNotFoundException
public AnnotationValue[] getAnnotations(Object obj)
AnnotationHelper
getAnnotations
in interface AnnotationHelper
obj
- the annotated object
public AnnotationValue createAnnotationValue(AnnotationInfo info, Object ann)
AnnotationHelper
createAnnotationValue
in interface AnnotationHelper
info
- the annotation infoann
- the underlying annotation
public MutableClassInfo getMutable(String name, ClassLoader cl)
MutableTypeInfoFactory
getMutable
in interface MutableTypeInfoFactory
name
- the name of the class to be retrievedcl
- the ClassLoader that should be used to retrieve the class. Note that,
if cl is null, the default ClassLoader will be used.
public MutableClassInfo createNewMutableClass(String name)
MutableTypeInfoFactory
createNewMutableClass
in interface MutableTypeInfoFactory
name
- the name of the class to be created
public MutableClassInfo createNewMutableClass(String name, ClassInfo superClass)
MutableTypeInfoFactory
createNewMutableClass
in interface MutableTypeInfoFactory
name
- the name of the class to be createdsuperClass
- the super class of the class to be created
public MutableClassInfo createNewMutableInterface(String name)
MutableTypeInfoFactory
createNewMutableInterface
in interface MutableTypeInfoFactory
name
- the name of the interface to be created
public MutableClassInfo createNewMutableInterface(String name, ClassInfo superClass)
MutableTypeInfoFactory
createNewMutableInterface
in interface MutableTypeInfoFactory
name
- the name of the interface to be createdsuperClass
- the super type of the interface to be created
protected TypeInfo getParameterizedType(ParameterizedType type)
type
- the parameterized type
protected TypeInfo getTypeInfo(ClassLoader loader, javassist.bytecode.SignatureAttribute.Type type, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
loader
- the class loadertype
- the class typespy
- used to determine actual types of type variables
protected TypeInfo getTypeInfo(ClassLoader loader, javassist.bytecode.SignatureAttribute.ClassType type, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
loader
- the class loader of the raw classtype
- the class typespy
- used to determine actual types of type variables
protected TypeInfo createTypeInfoForTypeArgument(javassist.bytecode.SignatureAttribute.TypeArgument arg, ClassLoader loader, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
arg
- the type argumentloader
- the class loaderspy
- used to determine actual types of type variables
protected TypeInfo getWildcardType(WildcardType type)
type
- the wildcard type
protected 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 instead
protected TypeInfo getGenericArrayType(GenericArrayType type)
type
- the array type
protected ArrayInfo getGenericArrayType(ClassLoader cl, javassist.bytecode.SignatureAttribute.ArrayType type, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
cl
- the classloadertype
- the array typespy
- used to determine actual types of type variables
protected ArrayInfo getGenericArrayType(ClassLoader cl, JavassistTypeInfoFactoryImpl.ModifiableArrayType type, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
cl
- the classloadertype
- the array typespy
- used to determine actual types of type variables
protected TypeInfo getTypeVariable(TypeVariable<?> type)
type
- the type variable
|
JBoss Reflection 2.2.1.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |