public class ClassInfoImpl extends InheritableAnnotationHolder implements ClassInfo
| Modifier and Type | Field and Description |
|---|---|
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
|
allAnnotations, allAnnotationsArray, annotatedElement, annotationHelper, declaredAnnotations, declaredAnnotationsArrayABSTRACT, 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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
static Class<?> |
getArrayClass(Class<?> clazz)
Get an array class
|
TypeInfo |
getArrayType()
Get an array type
|
<T> T |
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 name)
Get an attachment from the type
|
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 name)
Get the declared field
|
FieldInfo[] |
getDeclaredFields()
Get the declared fields
|
MethodInfo |
getDeclaredMethod(String name,
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 InheritableAnnotationHolder |
getSuperHolder()
Get the super holder of annoations
|
Class<? extends Object> |
getType()
Deprecated.
|
TypeInfoFactory |
getTypeInfoFactory()
Get the TypeInfoFactory that created this type info
|
TypeInfo |
getValueType()
Get the value type if it is a map
|
int |
hashCode() |
boolean |
isAnnotation()
Whether this type is an annotation
|
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()
Whether it is public
|
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 |
setSuperclass(ClassInfoImpl superInfo)
Set the super class
|
void |
setType(Class<?> type)
Set the type
|
void |
setTypeInfoFactory(TypeInfoFactory typeInfoFactory) |
protected void |
toString(org.jboss.util.JBossStringBuilder buffer) |
getAllAnnotations, getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent, setAnnotatedElement, setAnnotationHelper, setupAnnotationsgetUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresentcacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toShortString, toShortString, toString, toStringImplementationfinalize, getClass, notify, notifyAll, wait, wait, waitgetAnnotation, getAnnotations, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresentpublic 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 ClassInfo superclass
protected ClassInfo genericSuperclass
protected ConstructorInfo[] constructors
protected PackageInfo packageInfo
protected transient ClassInfoHelper classInfoHelper
protected transient TypeInfoFactory typeInfoFactory
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 classpublic TypeInfoFactory getTypeInfoFactory()
TypeInfogetTypeInfoFactory in interface TypeInfopublic 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 parameterspublic static ConstructorInfo findConstructor(ConstructorInfo[] constructors, TypeInfo[] parameters)
constructors - the constructorsparameters - the parameterspublic static Class<?> getArrayClass(Class<?> clazz)
clazz - the classpublic 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 setSuperclass(ClassInfoImpl superInfo)
superInfo - the super classpublic void setGenericSuperclass(ClassInfo superInfo)
superInfo - the super classpublic boolean isInterface()
ClassInfoisInterface in interface ClassInfopublic InterfaceInfo[] getInterfaces()
ClassInfogetInterfaces in interface ClassInfopublic InterfaceInfo[] getGenericInterfaces()
ClassInfogetGenericInterfaces in interface ClassInfopublic MethodInfo getDeclaredMethod(String name, TypeInfo[] parameters)
ClassInfogetDeclaredMethod in interface ClassInfoname - the method nameparameters - the parameterspublic MethodInfo[] getDeclaredMethods()
ClassInfogetDeclaredMethods in interface ClassInfopublic FieldInfo getDeclaredField(String name)
ClassInfogetDeclaredField in interface ClassInfoname - the field namepublic FieldInfo[] getDeclaredFields()
ClassInfogetDeclaredFields in interface ClassInfopublic ConstructorInfo getDeclaredConstructor(TypeInfo[] parameters)
ClassInfogetDeclaredConstructor in interface ClassInfoparameters - the parameterspublic ConstructorInfo[] getDeclaredConstructors()
ClassInfogetDeclaredConstructors in interface ClassInfopublic ClassInfo getSuperclass()
ClassInfogetSuperclass in interface ClassInfopublic ClassInfo getGenericSuperclass()
ClassInfogetGenericSuperclass in interface ClassInfopublic int getModifiers()
ModifierInfogetModifiers in interface ModifierInfopublic boolean isStatic()
ModifierInfoisStatic in interface ModifierInfopublic boolean isPublic()
ModifierInfoisPublic in interface ModifierInfopublic boolean isVolatile()
ModifierInfoisVolatile in interface ModifierInfopublic String getSimpleName()
TypeInfogetSimpleName in interface TypeInfo@Deprecated public Class<? extends Object> getType()
TypeInfopublic Object convertValue(Object value) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valueThrowable - for any errorpublic Object convertValue(Object value, boolean replaceProperties) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valuereplaceProperties - whether to replace propertiesThrowable - for any errorpublic Object convertValue(Object value, boolean replaceProperties, boolean trim) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valuereplaceProperties - whether to replace propertiestrim - do we trim before conversionThrowable - for any errorpublic boolean isArray()
TypeInfopublic boolean isCollection()
TypeInfoisCollection in interface TypeInfopublic boolean isMap()
TypeInfopublic boolean isAnnotation()
TypeInfoisAnnotation in interface TypeInfopublic boolean isEnum()
TypeInfopublic boolean isPrimitive()
TypeInfoisPrimitive in interface TypeInfopublic TypeInfo getArrayType()
TypeInfogetArrayType in interface TypeInfopublic Object newArrayInstance(int size) throws Throwable
TypeInfonewArrayInstance in interface TypeInfosize - the sizeThrowable - for any errorpublic boolean isAssignableFrom(TypeInfo info)
TypeInfoisAssignableFrom in interface TypeInfoinfo - type infoPrimitiveInfo tests for progressionpublic boolean isInstance(Object object)
TypeInfoisInstance in interface TypeInfoobject - the object to checkobject is an instance of this classPrimitiveInfo tests for progressionpublic TypeInfo[] getActualTypeArguments()
ClassInfogetActualTypeArguments in interface ClassInfopublic TypeInfo getOwnerType()
ClassInfogetOwnerType in interface ClassInfopublic ClassInfo getRawType()
ClassInfogetRawType in interface ClassInfopublic TypeInfo getComponentType()
ClassInfogetComponentType in interface ClassInfopublic TypeInfo getKeyType()
ClassInfogetKeyType in interface ClassInfopublic TypeInfo getValueType()
ClassInfogetValueType in interface ClassInfopublic PackageInfo getPackage()
ClassInfogetPackage in interface ClassInfopublic void setAttachment(String name, Object attachment)
TypeInfoIf 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 TypeInfoname - the nameattachment - the attachment, pass null to remove an attachmentpublic <T> T getAttachment(Class<T> expectedType)
TypeInfogetAttachment in interface TypeInfoT - the expected typeexpectedType - the expected typepublic Object getAttachment(String name)
TypeInfogetAttachment in interface TypeInfoname - the nameprotected InheritableAnnotationHolder getSuperHolder()
InheritableAnnotationHoldergetSuperHolder in class InheritableAnnotationHolderprotected void toString(org.jboss.util.JBossStringBuilder buffer)
toString in class org.jboss.util.JBossObjectpublic int hashCode()
hashCode in class org.jboss.util.JBossObjectCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.