Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.TypeInfo


            throw new RuntimeException("Invalid primitive info " + cl);
         }
      }
      else if (cl.isArray())
      {
         TypeInfo arrayType = ((ArrayInfo)cl).getComponentType();
         return "["+getTypeString(arrayType);
      }
      else
      {
         return "L"+cl.getName().replace('.','/')+";";
View Full Code Here


      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
View Full Code Here

   public TypeInfo getTypeInfo(Class clazz)
   {
      if (clazz == null)
         throw new IllegalArgumentException("Null class");

      TypeInfo primitive = PrimitiveInfo.valueOf(clazz.getName());
      if (primitive != null)
         return primitive;

      NumberInfo number = NumberInfo.valueOf(clazz.getName());
      if (number != null)
View Full Code Here

      String name = null;
      if (type instanceof Class)
         name = ((Class) type).getName();
      if (name != null)
      {
         TypeInfo primitive = PrimitiveInfo.valueOf(name);
         if (primitive != null)
            return primitive;

         NumberInfo number = NumberInfo.valueOf(name);
         if (number != null)
View Full Code Here

   public TypeInfo getTypeInfo(String name, ClassLoader cl) throws ClassNotFoundException
   {
      if (name == null)
         throw new IllegalArgumentException("Null class name");

      TypeInfo primitive = PrimitiveInfo.valueOf(name);
      if (primitive != null)
         return primitive;

      NumberInfo number = NumberInfo.valueOf(name);
      if (number != null)
View Full Code Here

    */
   @Override
   protected TypeInfo getGenericArrayType(GenericArrayType type)
   {
      Type compType = type.getGenericComponentType();
      TypeInfo componentType = getTypeInfo(compType);
      return new ArrayInfoImpl(componentType);
   }
View Full Code Here

   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());
View Full Code Here

   protected Map<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>> cache = new WeakHashMap<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>>();

   protected static boolean isGetter(MethodInfo minfo)
   {
      String name = minfo.getName();
      TypeInfo returnType = minfo.getReturnType();
      TypeInfo[] parameters = minfo.getParameterTypes();
      if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is")))
      {
         // isBoolean() is not a getter for java.lang.Boolean
         if (name.startsWith("is") && PrimitiveInfo.BOOLEAN.equals(returnType) == false)
View Full Code Here

   }

   protected static boolean isSetter(MethodInfo minfo)
   {
      String name = minfo.getName();
      TypeInfo returnType = minfo.getReturnType();
      TypeInfo[] parameters = minfo.getParameterTypes();
      if ((name.length() > 3 && name.startsWith("set")))
      {
         if (parameters.length == 1 && PrimitiveInfo.VOID.equals(returnType))
            return true;
View Full Code Here

            if (setterList != null && setterList.size() != 0)
            {
               for (int j = 0; j < setterList.size(); ++j)
               {
                  MethodInfo thisSetter = setterList.get(j);
                  TypeInfo pinfo = thisSetter.getParameterTypes()[0];
                  if (getter.getReturnType().equals(pinfo) == true)
                  {
                     setter = thisSetter;
                     break;
                  }
               }
            }
            String lowerName = getLowerPropertyName(name);

            // Merge the annotations between the getters and setters
            AnnotationValue[] annotations = getter.getAnnotations();
            AnnotationValue[] setterAnnotations = null;
            if (setter != null)
               setterAnnotations = setter.getAnnotations();
            annotations = mergeAnnotations(annotations, setterAnnotations);
            TypeInfo type = getPropertyType(getter, setter);
            properties.add(new DefaultPropertyInfo(lowerName, name, type, getter, setter, annotations));
         }
      }
      if (setters.isEmpty() == false)
      {
         for (Iterator<Map.Entry<String, List<MethodInfo>>> i = setters.entrySet().iterator(); i.hasNext();)
         {
            Map.Entry<String, List<MethodInfo>> entry = i.next();
            String name = entry.getKey();
            List<MethodInfo> setterList = entry.getValue();
            for(MethodInfo setter : setterList)
            {
               TypeInfo pinfo = setter.getParameterTypes()[0];
               String lowerName = getLowerPropertyName(name);
               AnnotationValue[] annotations = setter.getAnnotations();
               properties.add(new DefaultPropertyInfo(lowerName, name, pinfo, null, setter, annotations));
            }
         }
View Full Code Here

TOP

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

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.