Examples of WildcardType


Examples of java.lang.reflect.WildcardType

                }
                a.append(">;");
            }
            return a.toString();
        } else if (type instanceof WildcardType) {
            WildcardType wt = (WildcardType)type;
            StringBuilder a = new StringBuilder();
            java.lang.reflect.Type[] lowBounds = wt.getLowerBounds();
            java.lang.reflect.Type[] upBounds = wt.getUpperBounds();
            for (java.lang.reflect.Type t : upBounds) {
                a.append("+");
                a.append(getClassCode(t));
            }
            for (java.lang.reflect.Type t : lowBounds) {
View Full Code Here

Examples of java.lang.reflect.WildcardType

        }
        if (!ParameterizedType.class.isAssignableFrom(genericType.getClass())) {
            if (genericType instanceof TypeVariable) {
                genericType = getType(((TypeVariable)genericType).getBounds(), pos);
            } else if (genericType instanceof WildcardType) {
                WildcardType wildcardType = (WildcardType)genericType;
                Type[] bounds = wildcardType.getLowerBounds();
                if (bounds.length == 0) {
                    bounds = wildcardType.getUpperBounds();
                }
                genericType = getType(bounds, pos);
            }

            Class<?> cls = (Class<?>)genericType;
View Full Code Here

Examples of java.lang.reflect.WildcardType

    } else if (type instanceof GenericArrayType) {
      GenericArrayType g = (GenericArrayType) type;
      return new GenericArrayTypeImpl(g.getGenericComponentType());

    } else if (type instanceof WildcardType) {
      WildcardType w = (WildcardType) type;
      return new WildcardTypeImpl(w.getUpperBounds(), w.getLowerBounds());

    } else {
      // type is either serializable as-is or unsupported
      return type;
    }
View Full Code Here

Examples of java.lang.reflect.WildcardType

    } else if (a instanceof WildcardType) {
      if (!(b instanceof WildcardType)) {
        return false;
      }

      WildcardType wa = (WildcardType) a;
      WildcardType wb = (WildcardType) b;
      return Arrays.equals(wa.getUpperBounds(), wb.getUpperBounds())
          && Arrays.equals(wa.getLowerBounds(), wb.getLowerBounds());

    } else if (a instanceof TypeVariable) {
      if (!(b instanceof TypeVariable)) {
        return false;
      }
View Full Code Here

Examples of java.lang.reflect.WildcardType

        return changed
            ? Types.newParameterizedTypeWithOwner(newOwnerType, original.getRawType(), args)
            : original;

      } else if (toResolve instanceof WildcardType) {
        WildcardType original = (WildcardType) toResolve;
        Type[] originalLowerBound = original.getLowerBounds();
        Type[] originalUpperBound = original.getUpperBounds();

        if (originalLowerBound.length == 1) {
          Type lowerBound = resolveType(originalLowerBound[0]);
          if (lowerBound != originalLowerBound[0]) {
            return Types.supertypeOf(lowerBound);
View Full Code Here

Examples of java.lang.reflect.WildcardType

      return new GenericArrayTypeInformation((GenericArrayType) fieldType, this, variableMap);
    }

    if (fieldType instanceof WildcardType) {

      WildcardType wildcardType = (WildcardType) fieldType;
      Type[] bounds = wildcardType.getLowerBounds();

      if (bounds.length > 0) {
        return createInfo(bounds[0]);
      }

      bounds = wildcardType.getUpperBounds();

      if (bounds.length > 0) {
        return createInfo(bounds[0]);
      }
    }
View Full Code Here

Examples of java.lang.reflect.WildcardType

            }
         }
      }
      if (type1 instanceof WildcardType)
      {
         WildcardType wildcardType = (WildcardType) type1;
         if (isTypeBounded(type2, wildcardType.getLowerBounds(), wildcardType.getUpperBounds()))
         {
            return true;
         }
      }
      if (type2 instanceof WildcardType)
      {
         WildcardType wildcardType = (WildcardType) type2;
         if (isTypeBounded(type1, wildcardType.getUpperBounds(), wildcardType.getLowerBounds()))
         {
            return true;
         }
      }
      if (type1 instanceof TypeVariable<?>)
View Full Code Here

Examples of java.lang.reflect.WildcardType

            }
         }
      }
      if (type1 instanceof WildcardType)
      {
         WildcardType wildcardType = (WildcardType) type1;
         if (isTypeBounded(type2, wildcardType.getLowerBounds(), wildcardType.getUpperBounds()))
         {
            return true;
         }
      }
      if (type2 instanceof WildcardType)
      {
         WildcardType wildcardType = (WildcardType) type2;
         if (isTypeBounded(type1, wildcardType.getUpperBounds(), wildcardType.getLowerBounds()))
         {
            return true;
         }
      }
      if (type1 instanceof TypeVariable<?>)
View Full Code Here

Examples of java.lang.reflect.WildcardType

        assertThat(type, instanceOf(java.lang.reflect.ParameterizedType.class));
        java.lang.reflect.Type p =
            ((java.lang.reflect.ParameterizedType) type).getActualTypeArguments()[0];

        assertThat(p, instanceOf(WildcardType.class));
        WildcardType w = (WildcardType) p;

        assertThat(w.getLowerBounds().length, is(0));
        assertThat(w.getUpperBounds().length, is(1));
        assertThat(w.getUpperBounds()[0], is((java.lang.reflect.Type) Object.class));
    }
View Full Code Here

Examples of java.lang.reflect.WildcardType

        assertThat(type, instanceOf(java.lang.reflect.ParameterizedType.class));
        java.lang.reflect.Type p =
            ((java.lang.reflect.ParameterizedType) type).getActualTypeArguments()[0];

        assertThat(p, instanceOf(WildcardType.class));
        WildcardType w = (WildcardType) p;

        assertThat(w.getLowerBounds().length, is(0));
        assertThat(w.getUpperBounds().length, is(1));
        assertThat(w.getUpperBounds()[0], is((java.lang.reflect.Type) CharSequence.class));
    }
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.