Package org.jboss.reflect.plugins

Examples of org.jboss.reflect.plugins.ClassInfoImpl


/*     */   }
/*     */
/*     */   public ClassInfoImpl getSuperClass(ClassInfoImpl classInfo)
/*     */   {
/*  84 */     Class clazz = classInfo.getType();
/*  85 */     ClassInfoImpl superType = null;
/*  86 */     if (!clazz.isInterface())
/*     */     {
/*  88 */       Class superClazz = clazz.getSuperclass();
/*  89 */       if (superClazz != null)
/*  90 */         superType = (ClassInfoImpl)getTypeInfo(superClazz);
View Full Code Here


/* 368 */     return getTypeInfo(clazz);
/*     */   }
/*     */
/*     */   protected TypeInfo instantiate(Class<?> clazz)
/*     */   {
/*     */     ClassInfoImpl result;
/*     */     ClassInfoImpl result;
/* 374 */     if (clazz.isArray())
/*     */     {
/* 376 */       TypeInfo componentType = getTypeInfo(clazz.getComponentType());
/* 377 */       result = new ArrayInfoImpl(componentType);
/*     */     }
/* 379 */     else if (clazz.isEnum())
/*     */     {
/* 381 */       EnumInfoImpl enumInfoImpl = new EnumInfoImpl(clazz.getName(), clazz.getModifiers());
/* 382 */       ClassInfoImpl result = enumInfoImpl;
/* 383 */       Field[] fields = clazz.getFields();
/* 384 */       EnumConstantInfoImpl[] constants = new EnumConstantInfoImpl[fields.length];
/* 385 */       int i = 0;
/* 386 */       for (Field field : fields)
/*     */       {
/* 388 */         AnnotationValue[] annotations = getAnnotations(field);
/* 389 */         constants[(i++)] = new EnumConstantInfoImpl(field.getName(), enumInfoImpl, annotations);
/*     */       }
/* 391 */       enumInfoImpl.setEnumConstants(constants);
/*     */     }
/* 393 */     else if (clazz.isAnnotation())
/*     */     {
/* 395 */       ClassInfoImpl result = new AnnotationInfoImpl(clazz.getName(), clazz.getModifiers());
/* 396 */       Method[] methods = getDeclaredMethods(clazz);
/* 397 */       AnnotationAttributeImpl[] atttributes = new AnnotationAttributeImpl[methods.length];
/* 398 */       for (int i = 0; i < methods.length; i++)
/*     */       {
/* 400 */         atttributes[i] = new AnnotationAttributeImpl(methods[i].getName(), getTypeInfo(methods[i].getReturnType()), null);
/*     */       }
/* 402 */       ((AnnotationInfoImpl)result).setAttributes(atttributes);
/*     */     }
/*     */     else
/*     */     {
/* 406 */       result = new ReflectClassInfoImpl(clazz.getName());
/*     */     }
/* 408 */     result.setType(clazz);
/* 409 */     result.setTypeInfoFactory(this);
/* 410 */     result.setClassInfoHelper(this);
/* 411 */     result.setAnnotationHelper(this);
/* 412 */     return result;
/*     */   }
View Full Code Here

   }

   public ClassInfoImpl getSuperClass(ClassInfoImpl classInfo)
   {
      Class clazz = classInfo.getType();
      ClassInfoImpl superType = null;
      if (clazz.isInterface() == false)
      {
         Class superClazz = clazz.getSuperclass();
         if (superClazz != null)
            superType = (ClassInfoImpl) getTypeInfo(superClazz);
View Full Code Here

      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 if (clazz.isInterface())
      {
         result = new ReflectClassInfoImpl(clazz.getName());
      }
      else
      {
         result = new ReflectClassInfoImpl(clazz.getName());
      }
      result.setType(clazz);
      result.setTypeInfoFactory(this);
      result.setClassInfoHelper(this);
      result.setAnnotationHelper(this);
      return result;
   }
View Full Code Here

TOP

Related Classes of org.jboss.reflect.plugins.ClassInfoImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.