return getTypeInfo(clazz);
}
protected TypeInfo instantiate(Class<?> clazz)
{
ClassInfoImpl result;
if (clazz.isArray())
{
TypeInfo componentType = getTypeInfo(clazz.getComponentType());
result = new ArrayInfoImpl(componentType);
}
else if (clazz.isEnum())
{
EnumInfoImpl enumInfoImpl = new EnumInfoImpl(clazz.getName(), clazz.getModifiers());
result = enumInfoImpl;
Field[] fields = clazz.getFields();
EnumConstantInfoImpl[] constants = new EnumConstantInfoImpl[fields.length];
int i = 0;
for (Field field : fields)
{
AnnotationValue[] annotations = getAnnotations(field);
constants[i++] = new EnumConstantInfoImpl(field.getName(), enumInfoImpl, annotations);
}
enumInfoImpl.setEnumConstants(constants);
}
else if (clazz.isAnnotation())
{
result = new AnnotationInfoImpl(clazz.getName(), clazz.getModifiers());
Method[] methods = getDeclaredMethods(clazz);
AnnotationAttributeImpl[] atttributes = new AnnotationAttributeImpl[methods.length];
for (int i = 0 ; i < methods.length ; i++)
{
atttributes[i] = new AnnotationAttributeImpl(methods[i].getName(), getTypeInfo(methods[i].getReturnType()), null);
}
((AnnotationInfoImpl)result).setAttributes(atttributes);
}
else
{
result = new ReflectClassInfoImpl(clazz.getName());
}
result.setType(clazz);
result.setTypeInfoFactory(this);
result.setClassInfoHelper(this);
result.setAnnotationHelper(this);
return result;
}