JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins.javassist
Class JavassistTypeInfoFactory

java.lang.Object
  extended by org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory
All Implemented Interfaces:
MutableTypeInfoFactory, TypeInfoFactory
Direct Known Subclasses:
JavassistAnnotationHelper

public class JavassistTypeInfoFactory
extends Object
implements MutableTypeInfoFactory

An javassist type factory that uses a static delegate.

This avoids recalculating things everytime a factory is constructed inside the same classloader

Author:
Adrian Brock

Field Summary
protected static JavassistTypeInfoFactoryImpl delegate
          The delegate
 
Constructor Summary
JavassistTypeInfoFactory()
           
 
Method Summary
 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.
 MutableClassInfo getMutable(String name, ClassLoader cl)
          Gets the information for a MutableClass.
 TypeInfo getTypeInfo(Class<?> clazz)
          Get a type info
 TypeInfo getTypeInfo(String name, ClassLoader cl)
          Get a type info
 TypeInfo getTypeInfo(Type type)
          Get a type info
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected static JavassistTypeInfoFactoryImpl delegate
The delegate

Constructor Detail

JavassistTypeInfoFactory

public JavassistTypeInfoFactory()
Method Detail

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

getTypeInfo

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

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

createNewMutableClass

public MutableClassInfo createNewMutableClass(String name)
Description copied from interface: MutableTypeInfoFactory
Creates a new MutableClass.

Specified by:
createNewMutableClass in interface MutableTypeInfoFactory
Parameters:
name - the name of the class to be created
Returns:
the created class

createNewMutableClass

public MutableClassInfo createNewMutableClass(String name,
                                              ClassInfo superClass)
Description copied from interface: MutableTypeInfoFactory
Creates a new MutableClass.

Specified by:
createNewMutableClass in interface MutableTypeInfoFactory
Parameters:
name - the name of the class to be created
superClass - the super class of the class to be created
Returns:
the created class

createNewMutableInterface

public MutableClassInfo createNewMutableInterface(String name)
Description copied from interface: MutableTypeInfoFactory
Creates a new mutable interface.

Specified by:
createNewMutableInterface in interface MutableTypeInfoFactory
Parameters:
name - the name of the interface to be created
Returns:
the created interface

createNewMutableInterface

public MutableClassInfo createNewMutableInterface(String name,
                                                  ClassInfo superClass)
Description copied from interface: MutableTypeInfoFactory
Creates a new mutable interface.

Specified by:
createNewMutableInterface in interface MutableTypeInfoFactory
Parameters:
name - the name of the interface to be created
superClass - the super type of the interface to be created
Returns:
the created interface

getMutable

public MutableClassInfo getMutable(String name,
                                   ClassLoader cl)
Description copied from interface: MutableTypeInfoFactory
Gets the information for a MutableClass. Note that this will not put the MutableClass in any cache.

Specified by:
getMutable in interface MutableTypeInfoFactory
Parameters:
name - the name of the class to be retrieved
cl - the ClassLoader that should be used to retrieve the class. Note that, if cl is null, the default ClassLoader will be used.
Returns:
the MutableClassInfo representation of the queried class

JBoss Reflection 2.2.1.SP1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.