Examples of WildcardType


Examples of com.github.antlrjavaparser.api.type.WildcardType

        }
        else if (type instanceof VoidType) {
            return true;
        }
        else if (type instanceof WildcardType) {
            final WildcardType wType = (WildcardType) type;
            final WildcardType wType2 = (WildcardType) type2;
            return equals(wType.getSuper(), wType2.getSuper())
                    && equals(wType.getExtends(), wType2.getExtends());
        }
        return false;
    }
View Full Code Here

Examples of com.sun.tools.javac.code.Type.WildcardType

                Type qualifier = (tree.meth.getTag() == JCTree.SELECT)
                    ? ((JCFieldAccess) tree.meth).selected.type
                    : env.enclClass.sym.type;
                restype = new
                    ClassType(restype.getEnclosingType(),
                              List.<Type>of(new WildcardType(types.erasure(qualifier),
                                                               BoundKind.EXTENDS,
                                                               syms.boundClass)),
                              restype.tsym);
            }
View Full Code Here

Examples of japa.parser.ast.type.WildcardType

        if (internalType instanceof WildcardType) {
            // We only provide very primitive support for wildcard types; Roo
            // only needs metadata at the end of the day,
            // not complete binding support from an AST
            final WildcardType wt = (WildcardType) internalType;
            if (wt.getSuper() != null) {
                final ReferenceType rt = wt.getSuper();
                final ClassOrInterfaceType cit = (ClassOrInterfaceType) rt
                        .getType();
                final JavaType effectiveType = getJavaTypeNow(
                        compilationUnitServices, cit, typeParameters);
                return new JavaType(effectiveType.getFullyQualifiedTypeName(),
                        rt.getArrayCount(), effectiveType.getDataType(),
                        JavaType.WILDCARD_SUPER, effectiveType.getParameters());
            }
            else if (wt.getExtends() != null) {
                final ReferenceType rt = wt.getExtends();
                final ClassOrInterfaceType cit = (ClassOrInterfaceType) rt
                        .getType();
                final JavaType effectiveType = getJavaTypeNow(
                        compilationUnitServices, cit, typeParameters);
                return new JavaType(effectiveType.getFullyQualifiedTypeName(),
View Full Code Here

Examples of java.lang.reflect.WildcardType

      String typeDescription = "array of " + getTypeDescription(gType.getGenericComponentType());
      return typeDescription;
    }
    else if (type instanceof WildcardType)
    {
      WildcardType wType = (WildcardType) type;
      String typeDescription = "wildcard generic type";

      String upperDesc = getTypeArrayDescription(wType.getUpperBounds());
      String lowerDesc = getTypeArrayDescription(wType.getLowerBounds());

      if (StringUtils.notBlankOrNull(upperDesc))
        typeDescription = typeDescription + " with upper bound " + upperDesc;
      if (StringUtils.notBlankOrNull(lowerDesc))
        typeDescription = typeDescription + " and lower bound " + lowerDesc;
View Full Code Here

Examples of java.lang.reflect.WildcardType

        {
            ParameterizedType type = (ParameterizedType) genericType;

            if (type.getActualTypeArguments()[index] instanceof WildcardType)
            {
                WildcardType wildcardType = (WildcardType) type.getActualTypeArguments()[index];

                return wildcardType;
            }
            else if (type.getActualTypeArguments()[index] instanceof ParameterizedType)
            {
View Full Code Here

Examples of java.lang.reflect.WildcardType

                paramClass = (Class) type.getActualTypeArguments()[index];
            }

            else if (type.getActualTypeArguments()[index] instanceof WildcardType)
            {
                WildcardType wildcardType = (WildcardType) type.getActualTypeArguments()[index];

                if (wildcardType.getUpperBounds()[index] instanceof Class)
                {
                    paramClass = (Class) wildcardType.getUpperBounds()[index];
                }
            }
            else if (type.getActualTypeArguments()[index] instanceof ParameterizedType)
            {
                ParameterizedType ptype = (ParameterizedType) type.getActualTypeArguments()[index];
View Full Code Here

Examples of java.lang.reflect.WildcardType

                paramClass = (Class) type.getActualTypeArguments()[index];
            }

            else if (type.getActualTypeArguments()[index] instanceof WildcardType)
            {
                WildcardType wildcardType = (WildcardType) type.getActualTypeArguments()[index];

                if (wildcardType.getUpperBounds()[index] instanceof Class)
                {
                    paramClass = (Class) wildcardType.getUpperBounds()[index];
                }
            }
            else if (type.getActualTypeArguments()[index] instanceof ParameterizedType)
            {
                ParameterizedType ptype = (ParameterizedType) type.getActualTypeArguments()[index];
View Full Code Here

Examples of java.lang.reflect.WildcardType

      TypeVariable tv = (TypeVariable) type;
      Type[] ts = tv.getBounds();
      if (ts != null && ts.length > 0)
        return getTypeClass(ts[0]);
    } else if (type instanceof WildcardType) {
      WildcardType wt = (WildcardType) type;
      Type[] t_low = wt.getLowerBounds();// 取其下界
      if (t_low.length > 0)
        return getTypeClass(t_low[0]);
      Type[] t_up = wt.getUpperBounds(); // 没有下界?取其上界
      return getTypeClass(t_up[0]);// 最起码有Object作为上界
    }
    return clazz;
  }
View Full Code Here

Examples of java.lang.reflect.WildcardType

      ParameterizedType pt = (ParameterizedType) type;
      if (pt.getActualTypeArguments().length <= index) return null;
      return pt.getActualTypeArguments()[index] instanceof ParameterizedType ?
        getConcreteGeneric(pt.getRawType(), 0) : getConcreteGeneric(pt.getActualTypeArguments()[index], 0);
    } else if (type instanceof WildcardType) {
      WildcardType wt = (WildcardType) type;
      return wt.getUpperBounds().length <= index ? null : getConcreteGeneric(wt.getUpperBounds()[index], 0);
    } else if (type instanceof TypeVariable) {
      TypeVariable tt = (TypeVariable) type;
      return tt.getBounds().length <= index ? null : getConcreteGeneric(tt.getBounds()[index], 0);
    } else if (type instanceof GenericArrayType) {
      GenericArrayType gat = (GenericArrayType) type;
View Full Code Here

Examples of java.lang.reflect.WildcardType

      typeVariablesInProgress.remove(aType); // we have finished working on it

      return tvrt;
    } else if (aType instanceof WildcardType) {
      WildcardType wildType = (WildcardType) aType;
      Type[] lowerBounds = wildType.getLowerBounds();
      Type[] upperBounds = wildType.getUpperBounds();
      ResolvedType bound = null;
      boolean isExtends = lowerBounds.length == 0;
      if (isExtends) {
        bound = fromType(upperBounds[0]);
      } else {
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.