Examples of TypeVariable


Examples of java.lang.reflect.TypeVariable

        }
        if (type instanceof TypeVariable) {
            if (parameterizedTypes == null) {
                processParameterizedTypes();
            }
            TypeVariable var = (TypeVariable)type;
            Map<String, Class<?>> mp = parameterizedTypes.get(var.getGenericDeclaration());
            if (mp != null) {
                Class<?> c = parameterizedTypes.get(var.getGenericDeclaration()).get(var.getName());
                if (c != null) {
                    rawClass = c;
                    type = c;
                    part.getMessageInfo().setProperty("parameterized", Boolean.TRUE);
                }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

        }
        if (type instanceof TypeVariable) {
            if (parameterizedTypes == null) {
                processParameterizedTypes();
            }
            TypeVariable var = (TypeVariable)type;
            Map<String, Class<?>> mp = parameterizedTypes.get(var.getGenericDeclaration());
            if (mp != null) {
                Class<?> c = parameterizedTypes.get(var.getGenericDeclaration()).get(var.getName());
                if (c != null) {
                    rawClass = c;
                    type = c;
                    part.getMessageInfo().setProperty("parameterized", Boolean.TRUE);
                }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

        }
        if (type instanceof TypeVariable) {
            if (parameterizedTypes == null) {
                processParameterizedTypes();
            }
            TypeVariable var = (TypeVariable)type;
            Map<String, Class<?>> mp = parameterizedTypes.get(var.getGenericDeclaration());
            if (mp != null) {
                Class<?> c = parameterizedTypes.get(var.getGenericDeclaration()).get(var.getName());
                if (c != null) {
                    rawClass = c;
                    type = c;
                    part.getMessageInfo().setProperty("parameterized", Boolean.TRUE);
                }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

        } else if (type instanceof WildcardType) {
            WildcardType wType = (WildcardType)type;
            Type[] types = wType.getUpperBounds();
            return getErasure(types[0]);
        } else if (type instanceof TypeVariable) {
            TypeVariable var = (TypeVariable)type;
            Type[] types = var.getBounds();
            return getErasure(types[0]);
        }
        return null;
    }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

        }
        if (type instanceof TypeVariable) {
            if (parameterizedTypes == null) {
                processParameterizedTypes();
            }
            TypeVariable var = (TypeVariable)type;
            Map<String, Class<?>> mp = parameterizedTypes.get(var.getGenericDeclaration());
            if (mp != null) {
                Class<?> c = parameterizedTypes.get(var.getGenericDeclaration()).get(var.getName());
                if (c != null) {
                    rawClass = c;
                    type = c;
                    part.getMessageInfo().setProperty("parameterized", Boolean.TRUE);
                }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

      Class t = null;
      if(t0 instanceof Class)
         t = (Class) t0;
      else if(t0 instanceof TypeVariable)
      {
         TypeVariable tv = (TypeVariable) t0;
         t = (Class)tv.getBounds()[0];
         boundedTypes.add(t);
      }
      return t;
   }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

                ParameterizedType pt = (ParameterizedType) type;
                if(tvpos == -1) {

                    TypeVariable[] typeParameters = ((Class) pt.getRawType()).getTypeParameters();
                    for(int j = 0; j <  typeParameters.length; ++j) {
                        TypeVariable tp = typeParameters[j];
                        if(tp.getName().equals(((TypeVariable)var).getName())) {
                            tvpos = j;
                            break;
                        }
                    }
                }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

      Class t = null;
      if(t0 instanceof Class)
         t = (Class) t0;
      else if(t0 instanceof TypeVariable)
      {
         TypeVariable tv = (TypeVariable) t0;
         t = (Class)tv.getBounds()[0];
         boundedTypes.add(t);
      }
      return t;
   }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

            return getClassCode((Class)type);
        } else if (type instanceof GenericArrayType) {
            GenericArrayType at = (GenericArrayType)type;
            return "[" + getClassCode(at.getGenericComponentType());
        } else if (type instanceof TypeVariable) {
            TypeVariable tv = (TypeVariable)type;
            Type[] bounds = tv.getBounds();
            if (bounds != null && bounds.length == 1) {
                return getClassCode(bounds[0]);
            } else {
                throw new IllegalArgumentException("Unable to determine type for: " + tv);
            }
View Full Code Here

Examples of java.lang.reflect.TypeVariable

                ParameterizedType pt = (ParameterizedType)t;
                Type[] args = pt.getActualTypeArguments();
                for (int i = 0; i < args.length; i++) {
                    Type arg = args[i];
                    if (arg instanceof TypeVariable) {
                        TypeVariable var = (TypeVariable)arg;
                        Type[] bounds = var.getBounds();
                        boolean isResolved = false;
                        for (int j = 0; j < bounds.length; j++) {
                            Class<?> cls = InjectionUtils.getRawType(bounds[j]);
                            if (cls != null && cls.isAssignableFrom(expectedType)) {
                                isResolved = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.