Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.TypeInfo


   }
  
   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

      HashSet<PropertyInfo> properties = new HashSet<PropertyInfo>();
      if (methods != null && methods.isEmpty() == false)
      {
         for (MethodInfo method : methods)
         {
            TypeInfo returnType = method.getReturnType();
            TypeInfo[] parameters = method.getParameterTypes();
            if (parameters.length == 0 && PrimitiveInfo.VOID.equals(returnType) == false)
            {
               String name = method.getName();
               properties.add(new DefaultPropertyInfo(name, name, returnType, method, null, method.getAnnotations()));
View Full Code Here

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

      TypeInfo other = (TypeInfo) obj;
      return getName().equals(other.getName());
   }
View Full Code Here

   }
  
   public ClassAdapter getClassAdapter(Class<?> clazz)
   {
      TypeInfoFactory typeInfoFactory = configuration.getTypeInfoFactory();
      TypeInfo typeInfo = typeInfoFactory.getTypeInfo(clazz);
      return getClassAdapter(typeInfo);
   }
View Full Code Here

   }
  
   public ClassAdapter getClassAdapter(String name, ClassLoader cl) throws ClassNotFoundException
   {
      TypeInfoFactory typeInfoFactory = configuration.getTypeInfoFactory();
      TypeInfo typeInfo = typeInfoFactory.getTypeInfo(name, cl);
      return getClassAdapter(typeInfo);
   }
View Full Code Here

         for (int j = 0 ; j < methods.length ; j++)
         {
            try
            {
               Object val = methods[j].invoke(annotation, null);
               TypeInfo typeInfo = methods[j].getReturnType();
               Value value = createValue(annotationHelper, typeInfo, val);
               attributes.put(methods[j].getName(), value);
            }
            catch (Throwable e)
            {
View Full Code Here

   }

  
   private static Object[] getArray(ArrayInfo arrayInfo, Object value)
   {
      TypeInfo componentType = arrayInfo.getComponentType();
      if (!(componentType instanceof PrimitiveInfo))
      {
         return (Object[])value;
      }
      else
      {
         Object[] ret = null;
         String typeName = componentType.getName();

         if (typeName.equals("boolean"))
         {
            boolean[] input = (boolean[])value;
            ret = new Boolean[input.length];
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

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.