JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins.javassist
Class JavassistParameterizedClassInfo

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.spi.AbstractTypeInfo
          extended by org.jboss.reflect.spi.DelegateClassInfo
              extended by org.jboss.reflect.plugins.javassist.JavassistParameterizedClassInfo
All Implemented Interfaces:
Serializable, Cloneable, TypeVariableAware, AnnotatedInfo, ClassInfo, InterfaceInfo, ModifierInfo, TypeInfo, org.jboss.util.JBossInterface

public class JavassistParameterizedClassInfo
extends DelegateClassInfo
implements TypeVariableAware

Delegate class info to handle generic parameterized types in javassist

Version:
$Revision: 1.1 $
Author:
Kabir Khan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.reflect.spi.DelegateClassInfo
delegate
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.reflect.spi.ModifierInfo
ABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC
 
Constructor Summary
JavassistParameterizedClassInfo(JavassistTypeInfoFactoryImpl factory, ClassInfo delegate, ClassLoader classLoader, javassist.bytecode.SignatureAttribute.TypeArgument[] typeArguments, org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
          Constructor
JavassistParameterizedClassInfo(JavassistTypeInfoFactoryImpl factory, ClassInfo delegate, Type[] reflectTypeArguments)
          Constructor
 
Method Summary
 TypeInfo[] getActualTypeArguments()
          Get the actual type parameters
 ClassLoader getClassLoader()
          Get the classloader for this class info.
 ClassLoader getClassLoaderInternal()
           
 javassist.bytecode.SignatureAttribute.ClassSignature getClassSignature()
           
 TypeInfo getComponentType()
          Get the component type if it is a collection or an array
 JavassistTypeInfoFactoryImpl getFactory()
           
 TypeInfo getKeyType()
          Get the key type if it is a map
 TypeInfoFactory getTypeInfoFactory()
          Get the TypeInfoFactory that created this type info
 String getTypeVariable()
          Gets the type variable if we are a parameterized type which is part of a parameterized type and there is a type variable for this type.
 TypeInfo getValueType()
          Get the value type if it is a map
 void setTypeVariable(String typeVariable)
          Set the type variable
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.reflect.spi.DelegateClassInfo
convertValue, convertValue, convertValue, equals, equals, getAnnotation, getAnnotations, getArrayType, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethods, getDelegate, getGenericInterfaces, getGenericSuperclass, getHashCode, getInterfaces, getModifiers, getName, getOwnerType, getPackage, getRawType, getSimpleName, getSuperclass, getType, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotation, isAnnotationPresent, isAnnotationPresent, isArray, isAssignableFrom, isCollection, isEnum, isInitialized, isInstance, isInterface, isMap, isPrimitive, isPublic, isStatic, isVolatile, newArrayInstance, setDelegate, setDelegate
 
Methods inherited from class org.jboss.reflect.spi.AbstractTypeInfo
getAttachment, getAttachment, setAttachment
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.reflect.spi.ClassInfo
getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethods, getGenericInterfaces, getGenericSuperclass, getInterfaces, getName, getOwnerType, getPackage, getRawType, getSuperclass, isInterface
 
Methods inherited from interface org.jboss.reflect.spi.AnnotatedInfo
getAnnotation, getAnnotations, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresent
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString
 
Methods inherited from interface org.jboss.reflect.spi.ModifierInfo
getModifiers, isPublic, isStatic, isVolatile
 
Methods inherited from interface org.jboss.reflect.spi.TypeInfo
convertValue, convertValue, convertValue, getArrayType, getAttachment, getAttachment, getSimpleName, getType, isAnnotation, isArray, isAssignableFrom, isCollection, isEnum, isInstance, isMap, isPrimitive, newArrayInstance, setAttachment
 

Constructor Detail

JavassistParameterizedClassInfo

public JavassistParameterizedClassInfo(JavassistTypeInfoFactoryImpl factory,
                                       ClassInfo delegate,
                                       ClassLoader classLoader,
                                       javassist.bytecode.SignatureAttribute.TypeArgument[] typeArguments,
                                       org.jboss.reflect.plugins.javassist.JavassistTypeVariableSpy spy)
Constructor

Parameters:
factory - the javassist type info factory
delegate - the class info containing the parameterized type's raw type
classLoader - the class loader to use when lazily loading up the arguments
typeArguments - the javassist generic type arguments
spy - used to determine the actual bounds of generic type variables
Throws:
IllegalArgumentException - if any of the parameters are null

JavassistParameterizedClassInfo

public JavassistParameterizedClassInfo(JavassistTypeInfoFactoryImpl factory,
                                       ClassInfo delegate,
                                       Type[] reflectTypeArguments)
Constructor

Parameters:
factory - the javassist type info factory
delegate - the class info containing the parameterized type's raw type
reflectTypeArguments - the type infos for the type arguments
Throws:
IllegalArgumentException - if any of the parameters are null
Method Detail

setTypeVariable

public void setTypeVariable(String typeVariable)
Description copied from interface: TypeVariableAware
Set the type variable

Specified by:
setTypeVariable in interface TypeVariableAware

getTypeVariable

public String getTypeVariable()
Description copied from interface: ClassInfo
Gets the type variable if we are a parameterized type which is part of a parameterized type and there is a type variable for this type. This is useful in avoiding infinite recursion

Specified by:
getTypeVariable in interface ClassInfo
Overrides:
getTypeVariable in class DelegateClassInfo
Returns:
the type variable

getTypeInfoFactory

public TypeInfoFactory getTypeInfoFactory()
Description copied from interface: TypeInfo
Get the TypeInfoFactory that created this type info

Specified by:
getTypeInfoFactory in interface TypeInfo
Overrides:
getTypeInfoFactory in class DelegateClassInfo
Returns:
type info factory

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: TypeInfo
Get the classloader for this class info. Delay type creation if possible.

Specified by:
getClassLoader in interface TypeInfo
Overrides:
getClassLoader in class DelegateClassInfo
Returns:
class info's classloader

getActualTypeArguments

public TypeInfo[] getActualTypeArguments()
Description copied from interface: ClassInfo
Get the actual type parameters

Specified by:
getActualTypeArguments in interface ClassInfo
Overrides:
getActualTypeArguments in class DelegateClassInfo
Returns:
the type parameters. If there are none, a zero length array is returned

getComponentType

public TypeInfo getComponentType()
Description copied from interface: ClassInfo
Get the component type if it is a collection or an array

Specified by:
getComponentType in interface ClassInfo
Overrides:
getComponentType in class DelegateClassInfo
Returns:
the component type

getKeyType

public TypeInfo getKeyType()
Description copied from interface: ClassInfo
Get the key type if it is a map

Specified by:
getKeyType in interface ClassInfo
Overrides:
getKeyType in class DelegateClassInfo
Returns:
the key type

getValueType

public TypeInfo getValueType()
Description copied from interface: ClassInfo
Get the value type if it is a map

Specified by:
getValueType in interface ClassInfo
Overrides:
getValueType in class DelegateClassInfo
Returns:
the value type

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class DelegateClassInfo

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class DelegateClassInfo

getClassSignature

public javassist.bytecode.SignatureAttribute.ClassSignature getClassSignature()

getClassLoaderInternal

public ClassLoader getClassLoaderInternal()

getFactory

public JavassistTypeInfoFactoryImpl getFactory()

JBoss Reflection 2.2.1.SP1

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