Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.ClassInfo


    * @return the field info
    * @throws JoinpointException when no such field
    */
   public static FieldInfo findFieldInfo(ClassInfo classInfo, String name) throws JoinpointException
   {
      ClassInfo current = classInfo;
      while (current != null)
      {
         FieldInfo result = locateFieldInfo(current, name);
         if (result != null)
            return result;
         current = current.getSuperclass();
      }
      throw new JoinpointException("Field not found '" + name + "' for class " + classInfo.getName());
   }
View Full Code Here


   public static MethodInfo findMethodInfo(ClassInfo classInfo, String name, String[] paramTypes) throws JoinpointException
   {
      if (paramTypes == null)
         paramTypes = NO_PARAMS_TYPES;
     
      ClassInfo current = classInfo;
      while (current != null)
      {
         MethodInfo result = locateMethodInfo(current, name, paramTypes);
         if (result != null)
            return result;
         current = current.getSuperclass();
      }
      throw new JoinpointException("Method not found " + name + Arrays.asList(paramTypes) + " for class " + classInfo.getName());
   }
View Full Code Here

    */
   protected ClassAdapter createClassAdapter(TypeInfo typeInfo)
   {
      if (typeInfo instanceof ClassInfo == false)
         throw new IllegalArgumentException("Not a class " + typeInfo.getName());
      ClassInfo classInfo = (ClassInfo) typeInfo;
     
      return new ReflectClassAdapter(classInfo);
   }
View Full Code Here

      super(name);
   }
  
   public void testSimpleBeanClassInfo() throws Throwable
   {
      ClassInfo cinfo = getClassInfo(SimpleBean.class);

      assertEquals(SimpleBean.class.getName(), cinfo.getName());
      ClassInfo supercinfo = cinfo.getSuperclass();
      assertNotNull(supercinfo);
      assertEquals(Object.class.getName(), supercinfo.getName());
     
      HashSet expected = new HashSet();
      expected.add(Serializable.class.getName());
      expected.add(SimpleInterface.class.getName());
      checkTypeSet(expected, cinfo.getInterfaces());
View Full Code Here

      checkMethods(getSimpleInterfaceMethods(), simpleInterfaceInfo.getDeclaredMethods());
   }

   public void testSimpleBeanFields() throws Throwable
   {
      ClassInfo cinfo = getClassInfo(SimpleBean.class);
     
      checkFields(getSimpleBeanFields(), cinfo.getDeclaredFields());
   }
View Full Code Here

      checkFields(getSimpleBeanFields(), cinfo.getDeclaredFields());
   }

   public void testSimpleBeanMethods() throws Throwable
   {
      ClassInfo cinfo = getClassInfo(SimpleBean.class);
     
      checkMethods(getSimpleBeanMethods(), cinfo.getDeclaredMethods());
   }
View Full Code Here

      checkMethods(getSimpleBeanMethods(), cinfo.getDeclaredMethods());
   }

   public void testSimpleBeanConstructors() throws Throwable
   {
      ClassInfo cinfo = getClassInfo(SimpleBean.class);
     
      checkConstructors(getSimpleBeanConstructors(), cinfo.getDeclaredConstructors());
   }
View Full Code Here

   {
      IntrospectionTypeInfoFactory factory = new IntrospectionTypeInfoFactory();
      TypeInfo info = factory.getTypeInfo(clazz);
      assertNotNull(info);
      assertTrue(info instanceof ClassInfo);
      ClassInfo cinfo = (ClassInfo) info;
      getLog().debug(cinfo);
      return cinfo;
   }
View Full Code Here

      return cinfo;
   }
  
   protected InterfaceInfo getSimpleInterfaceInfo()
   {
      ClassInfo cinfo = getClassInfo(SimpleBean.class);
     
      InterfaceInfo simpleInterfaceInfo = null;
      InterfaceInfo[] interfaces = cinfo.getInterfaces();
      for (int i = 0; i < interfaces.length; ++i)
      {
         if (SimpleInterface.class.getName().equals(interfaces[i].getName()))
         {
            simpleInterfaceInfo = interfaces[i];
View Full Code Here

  
   protected Set getSimpleInterfaceFields()
   {
      TypeInfoFactory factory = new IntrospectionTypeInfoFactory();

      ClassInfo simpleInterface = (ClassInfo) factory.getTypeInfo(SimpleInterface.class);
     
      TypeInfo objectType = factory.getTypeInfo(Object.class);
     
      HashSet result = new HashSet();
      result.add(new FieldInfoImpl(null, "A_CONSTANT", objectType, ModifierInfo.PUBLIC_CONSTANT, simpleInterface));
View Full Code Here

TOP

Related Classes of org.jboss.reflect.spi.ClassInfo

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.