org.jboss.reflect.plugins.introspection
Class IntrospectionTypeInfoFactoryImpl

java.lang.Object
  extended by org.jboss.util.collection.WeakClassCache
      extended by org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl
All Implemented Interfaces:
TypeInfoFactory

public class IntrospectionTypeInfoFactoryImpl
extends org.jboss.util.collection.WeakClassCache
implements TypeInfoFactory

An introspection type factory. FIXME: use lazy loading to avoid reading the entire class model

Author:
Adrian Brock

Field Summary
 
Fields inherited from class org.jboss.util.collection.WeakClassCache
cache
 
Constructor Summary
IntrospectionTypeInfoFactoryImpl()
           
 
Method Summary
protected  void generate(Class clazz, Object result)
           
 void generateTypeInfo(Class clazz, ClassInfoImpl info)
          Generate the type info for a class
 AnnotationValue[] getAnnotations(Object obj)
           
 ClassInfo[] getClassInfos(Class[] classes)
          Get the class infos for some classes
 ConstructorInfoImpl[] getConstructors(Class clazz, ClassInfo declaring)
          Get the constructors
protected  Constructor[] getDeclaredConstructors(Class clazz)
           
protected  Field[] getDeclaredFields(Class clazz)
           
protected  Method[] getDeclaredMethods(Class clazz)
           
 FieldInfoImpl[] getFields(Class clazz, ClassInfo declaring)
          Get the fields
 InterfaceInfo[] getInterfaces(Class clazz)
          Get the interfaces
 MethodInfoImpl[] getMethods(Class clazz, ClassInfo declaring)
          Get the methods
 ClassInfo getSuperClass(Class clazz)
           
 TypeInfo getTypeInfo(Class clazz)
          Get a type info
 TypeInfo getTypeInfo(String name, ClassLoader cl)
          Get a type info
 TypeInfo[] getTypeInfos(Class[] classes)
          Get the type infos for some classes
protected  Object instantiate(Class clazz)
           
 
Methods inherited from class org.jboss.util.collection.WeakClassCache
get, get, getClassLoaderCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectionTypeInfoFactoryImpl

public IntrospectionTypeInfoFactoryImpl()
Method Detail

generateTypeInfo

public void generateTypeInfo(Class clazz,
                             ClassInfoImpl info)
Generate the type info for a class

Parameters:
clazz - the class
info - the class info

getSuperClass

public ClassInfo getSuperClass(Class clazz)

getAnnotations

public AnnotationValue[] getAnnotations(Object obj)

getConstructors

public ConstructorInfoImpl[] getConstructors(Class clazz,
                                             ClassInfo declaring)
Get the constructors

Parameters:
clazz - the class
declaring - the declaring class
Returns:
the constructor info

getFields

public FieldInfoImpl[] getFields(Class clazz,
                                 ClassInfo declaring)
Get the fields

Parameters:
clazz - the class
declaring - the declaring class
Returns:
the field info

getMethods

public MethodInfoImpl[] getMethods(Class clazz,
                                   ClassInfo declaring)
Get the methods

Parameters:
clazz - the class
declaring - the declaring class
Returns:
the method info

getInterfaces

public InterfaceInfo[] getInterfaces(Class clazz)
Get the interfaces

Parameters:
clazz - the class
Returns:
the interface info

getTypeInfos

public TypeInfo[] getTypeInfos(Class[] classes)
Get the type infos for some classes

Parameters:
classes - the classes
Returns:
the type infos

getClassInfos

public ClassInfo[] getClassInfos(Class[] classes)
Get the class infos for some classes

Parameters:
classes - the classes
Returns:
the class infos

getTypeInfo

public TypeInfo getTypeInfo(Class clazz)
Description copied from interface: TypeInfoFactory
Get a type info

Specified by:
getTypeInfo in interface TypeInfoFactory
Parameters:
clazz - the class
Returns:
the type info

getTypeInfo

public TypeInfo getTypeInfo(String name,
                            ClassLoader cl)
                     throws ClassNotFoundException
Description copied from interface: TypeInfoFactory
Get a type info

Specified by:
getTypeInfo in interface TypeInfoFactory
Parameters:
name - the class name
cl - the classloader
Returns:
the type info
Throws:
ClassNotFoundException - when there is no such class

instantiate

protected Object instantiate(Class clazz)
Specified by:
instantiate in class org.jboss.util.collection.WeakClassCache

generate

protected void generate(Class clazz,
                        Object result)
Specified by:
generate in class org.jboss.util.collection.WeakClassCache

getDeclaredConstructors

protected Constructor[] getDeclaredConstructors(Class clazz)

getDeclaredFields

protected Field[] getDeclaredFields(Class clazz)

getDeclaredMethods

protected Method[] getDeclaredMethods(Class clazz)


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.