Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.ClassInfo


      return SignatureTester.class.getDeclaredMethod("applyTimeZone", Calendar.class, TimeZone.class);
   }

   protected MethodInfo getMethodInfo()
   {
      ClassInfo classInfo = configuration.getClassInfo(SignatureTester.class);
      TypeInfo calendarTypeInfo = configuration.getTypeInfo(Calendar.class);
      TypeInfo timeZoneTypeInfo = configuration.getTypeInfo(TimeZone.class);
      return classInfo.getDeclaredMethod("applyTimeZone", new TypeInfo[]{calendarTypeInfo, timeZoneTypeInfo});
   }
View Full Code Here


      return SignatureTester.class.getDeclaredField("calendar");
   }

   protected FieldInfo getFieldInfo()
   {
      ClassInfo classInfo = configuration.getClassInfo(SignatureTester.class);
      return classInfo.getDeclaredField("calendar");
   }
View Full Code Here

      }

      Collection<Class<? extends Annotation>> annotationClasses = (annotations != null ? Arrays.asList(annotations.value()) : null);

      // class
      ClassInfo classInfo = info.getClassInfo();
      for(T plugin : getPlugins(ElementType.TYPE, null, annotationClasses))
      {
         if (isApplyPhase)
            applyPlugin(plugin, classInfo, retrieval, handle);
         else
            cleanPlugin(plugin, classInfo, retrieval, handle);
      }

      // constructors
      Set<ConstructorInfo> constructors = info.getConstructors();
      if (constructors != null && constructors.isEmpty() == false)
      {
         for(ConstructorInfo ci : constructors)
         {
            Signature cis = new ConstructorSignature(ci);
            MetaData cmdr = retrieval.getComponentMetaData(cis);
            if (cmdr != null)
            {
               for(T plugin : getPlugins(ElementType.CONSTRUCTOR, null, annotationClasses))
               {
                  if (isApplyPhase)
                     applyPlugin(plugin, ci, cmdr, handle);
                  else
                     cleanPlugin(plugin, ci, cmdr, handle);
               }
            }
            else if (trace)
               log.trace("No annotations for " + ci);
         }
      }
      else if (trace)
         log.trace("No constructors");

      // properties
      Set<MethodInfo> visitedMethods = new HashSet<MethodInfo>();
      Set<PropertyInfo> properties = info.getProperties();
      if (properties != null && properties.isEmpty() == false)
      {
         for(PropertyInfo pi : properties)
         {
            FieldInfo field = pi.getFieldInfo();
            if (field != null)
            {
               Signature sis = new FieldSignature(field);
               MetaData cmdr = retrieval.getComponentMetaData(sis);
               if (cmdr != null)
               {
                  for(T plugin : getPlugins(ElementType.FIELD, null, annotationClasses))
                  {
                     if (isApplyPhase)
                        applyPlugin(plugin, field, cmdr, handle);
                     else
                        cleanPlugin(plugin, field, cmdr, handle);
                  }
               }
               else if (trace)
                  log.trace("No annotations for field " + field.getName());
            }
            // apply setter and getter as well - if they exist
            handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getSetter(), "setter", annotationClasses);
            handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getGetter(), "getter", annotationClasses);
         }
      }
      else if (trace)
         log.trace("No properties");

      // get Object's class info - it's cached so it shouldn't take much
      TypeInfoFactory tif = classInfo.getTypeInfoFactory();
      TypeInfo objectTI = tif.getTypeInfo(Object.class);

      // method plugins
      Iterable<T> methodPlugins = null;

      // methods
      Set<MethodInfo> methods = info.getMethods();
      if (methods != null && methods.isEmpty() == false)
      {
         for(MethodInfo mi : methods)
         {
            ClassInfo declaringCI = mi.getDeclaringClass();
            // direct == check is OK
            if (declaringCI != objectTI && visitedMethods.contains(mi) == false)
            {
               Signature mis = new MethodSignature(mi);
               MetaData cmdr = retrieval.getComponentMetaData(mis);
View Full Code Here

   }

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

   }

   protected TypeInfo instantiate(ParameterizedType type)
   {
      Class rawType = (Class) type.getRawType();
      ClassInfo rawTypeInfo = (ClassInfo) getTypeInfo(rawType);
      if (rawTypeInfo instanceof ArrayInfo)
         return new ParameterizedArrayInfo(this, (ArrayInfo) rawTypeInfo, type);
      return new ParameterizedClassInfo(this, rawTypeInfo, type);
   }
View Full Code Here

      if (this == obj)
         return true;
      if (obj == null || obj instanceof ClassInfo == false)
         return false;

      final ClassInfo other = (ClassInfo) obj;

      String name = getName();
      if (name != null ? name.equals(other.getName()) == false : other.getName() != null)
         return false;
      return true;
   }
View Full Code Here

         accessMode = BeanAccessMode.STANDARD;

      synchronized (cache)
      {
         ClassLoader cl = classAdapter.getClassLoader();
         ClassInfo classInfo = classAdapter.getClassInfo();
         Map<ClassInfo, Map<BeanAccessMode, BeanInfo>> classInfoMap = cache.get(cl);
         Map<BeanAccessMode, BeanInfo> modeMap = null;
         if (classInfoMap != null)
         {
            modeMap = classInfoMap.get(classInfo);
            if (modeMap != null)
            {
               BeanInfo info = modeMap.get(accessMode);
               if (info != null)
                  return info;
            }
         }

         Set<ConstructorInfo> constructors = getConstructors(classInfo);
         Set<MethodInfo> methods = getMethods(classInfo);
         Set<PropertyInfo> properties;
         if (classInfo.isAnnotation())
            properties = getAnnotationProperties(methods);
         else
            properties = getBeanProperties(methods);
         Set<EventInfo> events = getEvents(classInfo);
View Full Code Here

    */
   public static FieldInfo findFieldInfo(ClassInfo classInfo, String name) throws JoinpointException
   {
      if (classInfo == null)
         throw new IllegalArgumentException("ClassInfo cannot be null!");
      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

         throw new IllegalArgumentException("ClassInfo cannot be null!");

      if (paramTypes == null)
         paramTypes = NO_PARAMS_TYPES;

      ClassInfo current = classInfo;
      while (current != null)
      {
         MethodInfo result = locateMethodInfo(current, name, paramTypes, isStatic, isPublic, strict);
         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

   @SuppressWarnings("deprecation")
   public ClassInfo getGenericSuperClass(ClassInfoImpl classInfo)
   {
      Class<?> clazz = classInfo.getType();
      ClassInfo superType = null;
      if (clazz.isInterface() == false)
      {
         Type superClazz = clazz.getGenericSuperclass();
         if (superClazz != null)
            superType = (ClassInfo) getTypeInfo(superClazz);
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.