Package java.lang.reflect

Examples of java.lang.reflect.GenericArrayType


      return componentType.hashCode();
    }

    @Override public boolean equals(Object obj) {
      if (obj instanceof GenericArrayType) {
        GenericArrayType that = (GenericArrayType) obj;
        return Objects.equal(
            getGenericComponentType(), that.getGenericComponentType());
      }
      return false;
    }
View Full Code Here


      if (!fromClass.isArray()) {
        return false;
      }
      return isAssignable(fromClass.getComponentType(), to.getGenericComponentType());
    } else if (from instanceof GenericArrayType) {
      GenericArrayType fromArrayType = (GenericArrayType) from;
      return isAssignable(fromArrayType.getGenericComponentType(), to.getGenericComponentType());
    } else {
      return false;
    }
  }
View Full Code Here

      if (!toClass.isArray()) {
        return toClass == Object.class; // any T[] is assignable to Object
      }
      return isAssignable(from.getGenericComponentType(), toClass.getComponentType());
    } else if (to instanceof GenericArrayType) {
      GenericArrayType toArrayType = (GenericArrayType) to;
      return isAssignable(from.getGenericComponentType(), toArrayType.getGenericComponentType());
    } else {
      return false;
    }
  }
View Full Code Here

            } else if(JAXBElement.class == type) {
                return Object.class;
            }
            return (Class<?>) type;
        } else if (genericType instanceof GenericArrayType) {
            GenericArrayType genericArrayType = (GenericArrayType) genericType;
            return getDomainClass(genericArrayType.getGenericComponentType());
        } else {
            return Object.class;
        }
    }
View Full Code Here

         if (fieldClass.isArray()) {
            Type genericType = field.getGenericType();
            if (genericType instanceof Class) {
               return fieldClass.getComponentType();
            }
            GenericArrayType genericArrayType = (GenericArrayType) genericType;
            TypeVariable genericComponentType = (TypeVariable) genericArrayType.getGenericComponentType();
            return (Class) genericComponentType.getBounds()[0];
         } else if (Collection.class.isAssignableFrom(fieldClass)) {
            return determineCollectionElementTypeParam(field.getGenericType());
         } else if (Map.class.isAssignableFrom(fieldClass)) {
            return determineMapValueTypeParam(field.getGenericType());
View Full Code Here

        {
            raw = (Class<?>)type;
        }
        else if(type instanceof GenericArrayType)
        {
            GenericArrayType arrayType = (GenericArrayType)type;
            raw = getClazz(arrayType.getGenericComponentType());
        }
       
        return raw;
    }
View Full Code Here

                    if (isFromWrapper) {
                        addType(clazz.getComponentType(), true);
                    }
                } else if (pt.getActualTypeArguments().length > 0
                    && pt.getActualTypeArguments()[0] instanceof GenericArrayType) {
                    GenericArrayType gat = (GenericArrayType)pt.getActualTypeArguments()[0];
                    gat.getGenericComponentType();
                    Class<? extends Object> arrayCls =
                        Array.newInstance((Class) gat.getGenericComponentType(), 0).getClass();
                    clazz = Array.newInstance(arrayCls, 0).getClass();
                    part.setTypeClass(clazz);
                    if (isFromWrapper) {
                        addType(clazz.getComponentType(), true);
                    }
View Full Code Here

            for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
                addType(t2);
            }
        } else if (cls instanceof GenericArrayType) {
            Class ct;
            GenericArrayType gt = (GenericArrayType)cls;
            Type componentType = gt.getGenericComponentType();
            if (componentType instanceof Class) {
                ct = (Class)componentType;
            } else {
                TypeVariable tv = (TypeVariable)componentType;
                Type[] bounds = tv.getBounds();
View Full Code Here

        } else if (cls instanceof ParameterizedType) {
            for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
                return getArrayComponentType(t2);
            }
        } else if (cls instanceof GenericArrayType) {
            GenericArrayType gt = (GenericArrayType)cls;
            Class ct = (Class) gt.getGenericComponentType();
            return Array.newInstance(ct, 0).getClass();
        }
        return null;
    }
View Full Code Here

        } else if (cls instanceof ParameterizedType) {
            for (Type t2 : ((ParameterizedType)cls).getActualTypeArguments()) {
                return getBeanInfo(t2);
            }
        } else if (cls instanceof GenericArrayType) {
            GenericArrayType gt = (GenericArrayType)cls;
            Class ct = (Class) gt.getGenericComponentType();
            ct = Array.newInstance(ct, 0).getClass();

            return getBeanInfo(ct);
        }
View Full Code Here

TOP

Related Classes of java.lang.reflect.GenericArrayType

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.