|
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.JBossObject
org.jboss.reflect.plugins.AbstractAnnotatedInfo
org.jboss.reflect.plugins.InheritableAnnotationHolder
org.jboss.reflect.plugins.ClassInfoImpl
public class ClassInfoImpl
Class info TODO JBREFLECT-4 fix the introspection assumption
Nested Class Summary | |
---|---|
static class |
ClassInfoImpl.MarshalledClassInfo
|
Field Summary | |
---|---|
protected ClassInfoHelper |
classInfoHelper
The class info helper |
protected ConstructorInfo[] |
constructors
The constructor info |
protected HashMap<String,FieldInfo> |
fieldMap
Field map Map |
protected FieldInfo[] |
fields
The fields |
protected InterfaceInfo[] |
genericInterfaces
The generic interfaces |
protected ClassInfo |
genericSuperclass
The generic super class |
protected InterfaceInfo[] |
interfaces
The interfaces |
protected MethodInfo[] |
methods
The methods |
protected int |
modifiers
The class modifiers |
protected String |
name
The class name |
protected PackageInfo |
packageInfo
The package info |
protected ClassInfo |
superclass
The super class |
protected TypeInfoFactory |
typeInfoFactory
The type info factory |
static ClassInfo |
UNKNOWN_CLASS
Marker for generation |
static ClassInfo[] |
UNKNOWN_CLASSES
Marker for generation |
static ConstructorInfo[] |
UNKNOWN_CONSTRUCTORS
Marker for generation |
static FieldInfo[] |
UNKNOWN_FIELDS
Marker for generation |
static InterfaceInfo[] |
UNKNOWN_INTERFACES
Marker for generation |
static MethodInfo[] |
UNKNOWN_METHODS
Marker for generation |
static TypeInfo |
UNKNOWN_TYPE
Marker for generation |
static TypeInfo[] |
UNKNOWN_TYPES
Marker for generation |
Fields inherited from class org.jboss.reflect.plugins.InheritableAnnotationHolder |
---|
allAnnotations, allAnnotationsArray, annotatedElement, annotationHelper, declaredAnnotations, declaredAnnotationsArray |
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 | |
---|---|
ClassInfoImpl()
Create a new abstract ClassInfo. |
|
ClassInfoImpl(String name)
Create a new class info |
|
ClassInfoImpl(String name,
int modifiers)
Create a new abstract ClassInfo. |
|
ClassInfoImpl(String name,
int modifiers,
InterfaceInfo[] interfaces,
ClassInfoImpl superclass)
Create a new abstract ClassInfo. |
Method Summary | ||
---|---|---|
Object |
convertValue(Object value)
Convert a value |
|
Object |
convertValue(Object value,
boolean replaceProperties)
Convert a value |
|
Object |
convertValue(Object value,
boolean replaceProperties,
boolean trim)
Convert a value |
|
boolean |
equals(Object obj)
|
|
static ConstructorInfo |
findConstructor(ConstructorInfo[] constructors,
TypeInfo[] parameters)
Find a constructor |
|
static MethodInfo |
findMethod(MethodInfo[] methods,
String name,
TypeInfo[] parameters)
Find a method |
|
TypeInfo[] |
getActualTypeArguments()
Get the actual type parameters |
|
AnnotationValue |
getAnnotation(String name)
Get an annotation |
|
AnnotationValue[] |
getAnnotations()
Get the annotations |
|
static Class<?> |
getArrayClass(Class<?> clazz)
Get an array class |
|
TypeInfo |
getArrayType()
Get an array type |
|
|
getAttachment(Class<T> expectedType)
Get an attachment from the type, uses the expected type as both the name and to cast the resulting object. |
|
Object |
getAttachment(String attachName)
Get an attachment from the type |
|
ClassLoader |
getClassLoader()
Get the classloader for this class info. |
|
TypeInfo |
getComponentType()
Get the component type if it is a collection or an array |
|
ConstructorInfo |
getDeclaredConstructor(TypeInfo... parameters)
Get a declared constructor |
|
ConstructorInfo[] |
getDeclaredConstructors()
Get the declared constructors |
|
FieldInfo |
getDeclaredField(String fieldName)
Get the declared field |
|
FieldInfo[] |
getDeclaredFields()
Get the declared fields |
|
MethodInfo |
getDeclaredMethod(String methodName,
TypeInfo... parameters)
Get the declared method |
|
MethodInfo[] |
getDeclaredMethods()
Get the declared methods |
|
InterfaceInfo[] |
getGenericInterfaces()
Get the generic interfaces |
|
ClassInfo |
getGenericSuperclass()
Get the generic super class |
|
InterfaceInfo[] |
getInterfaces()
Get the interfaces |
|
TypeInfo |
getKeyType()
Get the key type if it is a map |
|
int |
getModifiers()
Get the modifiers |
|
String |
getName()
Get the class name |
|
TypeInfo |
getOwnerType()
Get the owner type |
|
PackageInfo |
getPackage()
Get the package |
|
ClassInfo |
getRawType()
Get the raw type |
|
String |
getSimpleName()
Get the simple name |
|
ClassInfo |
getSuperclass()
Get the super class |
|
protected ClassInfo |
getSuperHolder()
Get the super holder of annoations |
|
Class<? extends Object> |
getType()
Deprecated. |
|
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 |
|
int |
hashCode()
|
|
boolean |
isAnnotation()
Whether this type is an annotation |
|
boolean |
isAnnotationPresent(String name)
Test whether an annotation is present |
|
boolean |
isArray()
Whether this type is an array |
|
boolean |
isAssignableFrom(TypeInfo info)
Mostly using |
|
boolean |
isCollection()
Whether this type is a collection |
|
boolean |
isEnum()
Whether this type is an enum |
|
boolean |
isInstance(Object object)
Is object instance of this type info. |
|
boolean |
isInterface()
Whether it is an interface |
|
boolean |
isMap()
Whether this type is a map |
|
boolean |
isPrimitive()
Whether this type is a primitive |
|
boolean |
isPublic()
|
|
boolean |
isStatic()
Whether it is static |
|
boolean |
isVolatile()
Whether it is volatile |
|
Object |
newArrayInstance(int size)
Create a new array |
|
void |
setAttachment(String name,
Object attachment)
Set an attachment against the type. |
|
void |
setClassInfoHelper(ClassInfoHelper classInfoHelper)
|
|
void |
setDeclaredConstructors(ConstructorInfoImpl[] constructors)
Set the declared constructors |
|
void |
setDeclaredFields(FieldInfoImpl[] fields)
Set the declared fields |
|
void |
setDeclaredMethods(MethodInfoImpl[] methods)
Set the declared methods |
|
void |
setGenericInterfaces(InterfaceInfo[] interfaces)
Set the generic interfaces |
|
void |
setGenericSuperclass(ClassInfo superInfo)
Set the generic super class |
|
void |
setInterfaces(InterfaceInfo[] interfaces)
Set the interfaces |
|
void |
setType(Class<?> type)
Set the type |
|
void |
setTypeInfoFactory(TypeInfoFactory typeInfoFactory)
|
|
protected void |
toString(org.jboss.util.JBossStringBuilder buffer)
|
|
protected Object |
writeReplace()
|
Methods inherited from class org.jboss.reflect.plugins.InheritableAnnotationHolder |
---|
getAllAnnotations, getDeclaredAnnotation, getDeclaredAnnotations, isDeclaredAnnotationPresent, setAnnotatedElement, setAnnotationHelper, setupAnnotations |
Methods inherited from class org.jboss.reflect.plugins.AbstractAnnotatedInfo |
---|
getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent |
Methods inherited from class org.jboss.util.JBossObject |
---|
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toShortString, 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.AnnotatedInfo |
---|
getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent |
Methods inherited from interface org.jboss.util.JBossInterface |
---|
clone, toShortString, toShortString |
Field Detail |
---|
public static final ClassInfo UNKNOWN_CLASS
public static final ClassInfo[] UNKNOWN_CLASSES
public static final TypeInfo UNKNOWN_TYPE
public static final TypeInfo[] UNKNOWN_TYPES
public static final InterfaceInfo[] UNKNOWN_INTERFACES
public static final ConstructorInfo[] UNKNOWN_CONSTRUCTORS
public static final MethodInfo[] UNKNOWN_METHODS
public static final FieldInfo[] UNKNOWN_FIELDS
protected String name
protected int modifiers
protected InterfaceInfo[] interfaces
protected InterfaceInfo[] genericInterfaces
protected MethodInfo[] methods
protected FieldInfo[] fields
protected HashMap<String,FieldInfo> fieldMap
protected ClassInfo superclass
protected ClassInfo genericSuperclass
protected ConstructorInfo[] constructors
protected PackageInfo packageInfo
protected transient ClassInfoHelper classInfoHelper
protected transient TypeInfoFactory typeInfoFactory
Constructor Detail |
---|
public ClassInfoImpl()
public ClassInfoImpl(String name)
name
- the class namepublic ClassInfoImpl(String name, int modifiers)
name
- the class namemodifiers
- the class modifierspublic ClassInfoImpl(String name, int modifiers, InterfaceInfo[] interfaces, ClassInfoImpl superclass)
name
- the class namemodifiers
- the class modifiersinterfaces
- the interfacessuperclass
- the super classMethod Detail |
---|
public AnnotationValue[] getAnnotations()
AnnotatedInfo
getAnnotations
in interface AnnotatedInfo
getAnnotations
in class InheritableAnnotationHolder
public AnnotationValue getAnnotation(String name)
AnnotatedInfo
getAnnotation
in interface AnnotatedInfo
getAnnotation
in class InheritableAnnotationHolder
name
- the name
public boolean isAnnotationPresent(String name)
AnnotatedInfo
isAnnotationPresent
in interface AnnotatedInfo
isAnnotationPresent
in class InheritableAnnotationHolder
name
- the name
public TypeInfoFactory getTypeInfoFactory()
TypeInfo
getTypeInfoFactory
in interface TypeInfo
public void setTypeInfoFactory(TypeInfoFactory typeInfoFactory)
public void setClassInfoHelper(ClassInfoHelper classInfoHelper)
public static MethodInfo findMethod(MethodInfo[] methods, String name, TypeInfo[] parameters)
methods
- the methodsname
- the nameparameters
- the parameters
public static ConstructorInfo findConstructor(ConstructorInfo[] constructors, TypeInfo[] parameters)
constructors
- the constructorsparameters
- the parameters
public static Class<?> getArrayClass(Class<?> clazz)
clazz
- the class
public void setType(Class<?> type)
type
- the classpublic void setInterfaces(InterfaceInfo[] interfaces)
interfaces
- the interfacespublic void setGenericInterfaces(InterfaceInfo[] interfaces)
interfaces
- the interfacespublic void setDeclaredMethods(MethodInfoImpl[] methods)
methods
- the methodspublic void setDeclaredFields(FieldInfoImpl[] fields)
fields
- the fieldspublic void setDeclaredConstructors(ConstructorInfoImpl[] constructors)
constructors
- the constructorspublic void setGenericSuperclass(ClassInfo superInfo)
superInfo
- the super classpublic boolean isInterface()
ClassInfo
isInterface
in interface ClassInfo
public InterfaceInfo[] getInterfaces()
ClassInfo
getInterfaces
in interface ClassInfo
public InterfaceInfo[] getGenericInterfaces()
ClassInfo
getGenericInterfaces
in interface ClassInfo
public MethodInfo getDeclaredMethod(String methodName, TypeInfo... parameters)
ClassInfo
getDeclaredMethod
in interface ClassInfo
methodName
- the method nameparameters
- the parameters
public MethodInfo[] getDeclaredMethods()
ClassInfo
getDeclaredMethods
in interface ClassInfo
public FieldInfo getDeclaredField(String fieldName)
ClassInfo
getDeclaredField
in interface ClassInfo
fieldName
- the field name
public FieldInfo[] getDeclaredFields()
ClassInfo
getDeclaredFields
in interface ClassInfo
public ConstructorInfo getDeclaredConstructor(TypeInfo... parameters)
ClassInfo
getDeclaredConstructor
in interface ClassInfo
parameters
- the parameters
public ConstructorInfo[] getDeclaredConstructors()
ClassInfo
getDeclaredConstructors
in interface ClassInfo
public ClassInfo getSuperclass()
ClassInfo
getSuperclass
in interface ClassInfo
public ClassInfo getGenericSuperclass()
ClassInfo
getGenericSuperclass
in interface ClassInfo
public int getModifiers()
ModifierInfo
getModifiers
in interface ModifierInfo
public boolean isStatic()
ModifierInfo
isStatic
in interface ModifierInfo
public boolean isPublic()
isPublic
in interface ModifierInfo
public boolean isVolatile()
ModifierInfo
isVolatile
in interface ModifierInfo
public String getName()
ClassInfo
getName
in interface ClassInfo
getName
in interface TypeInfo
public String getSimpleName()
TypeInfo
getSimpleName
in interface TypeInfo
@Deprecated public Class<? extends Object> getType()
TypeInfo
getType
in interface TypeInfo
public ClassLoader getClassLoader()
TypeInfo
getClassLoader
in interface TypeInfo
public Object convertValue(Object value) throws Throwable
TypeInfo
convertValue
in interface TypeInfo
value
- the original value
Throwable
- for any errorpublic Object convertValue(Object value, boolean replaceProperties) throws Throwable
TypeInfo
convertValue
in interface TypeInfo
value
- the original valuereplaceProperties
- whether to replace properties
Throwable
- for any errorpublic Object convertValue(Object value, boolean replaceProperties, boolean trim) throws Throwable
TypeInfo
convertValue
in interface TypeInfo
value
- the original valuereplaceProperties
- whether to replace propertiestrim
- do we trim before conversion
Throwable
- for any errorpublic boolean isArray()
TypeInfo
isArray
in interface TypeInfo
public boolean isCollection()
TypeInfo
isCollection
in interface TypeInfo
public boolean isMap()
TypeInfo
isMap
in interface TypeInfo
public boolean isAnnotation()
TypeInfo
isAnnotation
in interface TypeInfo
public boolean isEnum()
TypeInfo
isEnum
in interface TypeInfo
public boolean isPrimitive()
TypeInfo
isPrimitive
in interface TypeInfo
public TypeInfo getArrayType()
TypeInfo
getArrayType
in interface TypeInfo
public Object newArrayInstance(int size) throws Throwable
TypeInfo
newArrayInstance
in interface TypeInfo
size
- the size
Throwable
- for any errorpublic boolean isAssignableFrom(TypeInfo info)
TypeInfo
isAssignableFrom
in interface TypeInfo
info
- type info
PrimitiveInfo tests for progression
public boolean isInstance(Object object)
TypeInfo
isInstance
in interface TypeInfo
object
- the object to check
object
is an instance of this classPrimitiveInfo tests for progression
public TypeInfo[] getActualTypeArguments()
ClassInfo
getActualTypeArguments
in interface ClassInfo
public TypeInfo getOwnerType()
ClassInfo
getOwnerType
in interface ClassInfo
public ClassInfo getRawType()
ClassInfo
getRawType
in interface ClassInfo
public TypeInfo getComponentType()
ClassInfo
getComponentType
in interface ClassInfo
public TypeInfo getKeyType()
ClassInfo
getKeyType
in interface ClassInfo
public TypeInfo getValueType()
ClassInfo
getValueType
in interface ClassInfo
public PackageInfo getPackage()
ClassInfo
getPackage
in interface ClassInfo
public void setAttachment(String name, Object attachment)
TypeInfo
If you add a future object, subsequent gets will wait for the result
WARNING: Be careful about what you put in here. Don't create references across classloaders, if you are not sure add a WeakReference to the information.
setAttachment
in interface TypeInfo
name
- the nameattachment
- the attachment, pass null to remove an attachmentpublic <T> T getAttachment(Class<T> expectedType)
TypeInfo
getAttachment
in interface TypeInfo
T
- the expected typeexpectedType
- the expected type
public Object getAttachment(String attachName)
TypeInfo
getAttachment
in interface TypeInfo
attachName
- the name
protected ClassInfo getSuperHolder()
InheritableAnnotationHolder
getSuperHolder
in class InheritableAnnotationHolder
protected void toString(org.jboss.util.JBossStringBuilder buffer)
toString
in class org.jboss.util.JBossObject
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class org.jboss.util.JBossObject
protected Object writeReplace()
public String getTypeVariable()
ClassInfo
getTypeVariable
in interface ClassInfo
|
JBoss Reflection 2.2.1.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |