Package com.alibaba.citrus.generictype

Examples of com.alibaba.citrus.generictype.RawTypeInfo


        }

        ParameterizedTypeImpl parameterizedTypeInfo = buildingCache.getParameterizedType(type);

        if (parameterizedTypeInfo == null) {
            RawTypeInfo rawType = buildRawType((Class<?>) type.getRawType(), buildingCache);

            parameterizedTypeInfo = new ParameterizedTypeImpl(rawType);
            buildingCache.setParameterizedType(type, parameterizedTypeInfo);

            // 取得actual type arguments
            TypeInfo[] args = buildTypes(type.getActualTypeArguments(), buildingCache);

            // 修正wildcard的upper bounds为对应var的upper bounds
            // 例如,var为<T extends Number>,而wildcard未指定upper bounds,那么修正wildcard的upper bounds为Number
            for (int i = 0; i < args.length; i++) {
                TypeInfo arg = args[i];

                if (arg instanceof WildcardTypeInfo && ((WildcardTypeInfo) arg).isUnknown()) {
                    TypeVariable<?> var = rawType.getRawType().getTypeParameters()[i];
                    TypeInfo[] upperBounds = buildTypes(var.getBounds(), buildingCache);

                    args[i] = new UnknownWildcardTypeImpl((WildcardTypeInfo) arg, upperBounds);
                }
            }
View Full Code Here


        private final List<TypeInfo> supertypes;
        private final List<TypeInfo> interfaces;
        private final List<TypeInfo> superclasses;

        private Supertypes(ParameterizedTypeImpl parameterizedType) {
            RawTypeInfo rawType = parameterizedType.rawType;
            List<TypeInfo> rawSupertypes = rawType.getSupertypes();
            List<TypeInfo> rawInterfaces = rawType.getInterfaces();
            List<TypeInfo> rawSuperclasses = rawType.getSuperclasses();

            List<TypeInfo> supertypes = createArrayList(rawSupertypes.size());
            List<TypeInfo> interfaces = createArrayList(rawInterfaces.size());
            List<TypeInfo> superclasses = createArrayList(rawSuperclasses.size());
View Full Code Here

        }

        ParameterizedTypeImpl parameterizedTypeInfo = buildingCache.getParameterizedType(type);

        if (parameterizedTypeInfo == null) {
            RawTypeInfo rawType = buildRawType((Class<?>) type.getRawType(), buildingCache);

            parameterizedTypeInfo = new ParameterizedTypeImpl(rawType);
            buildingCache.setParameterizedType(type, parameterizedTypeInfo);

            // ȡ��actual type arguments
            TypeInfo[] args = buildTypes(type.getActualTypeArguments(), buildingCache);

            // ����wildcard��upper boundsΪ��Ӧvar��upper bounds
            // ���磬varΪ<T extends Number>����wildcardδָ��upper bounds����ô����wildcard��upper boundsΪNumber
            for (int i = 0; i < args.length; i++) {
                TypeInfo arg = args[i];

                if (arg instanceof WildcardTypeInfo && ((WildcardTypeInfo) arg).isUnknown()) {
                    TypeVariable<?> var = rawType.getRawType().getTypeParameters()[i];
                    TypeInfo[] upperBounds = buildTypes(var.getBounds(), buildingCache);

                    args[i] = new UnknownWildcardTypeImpl((WildcardTypeInfo) arg, upperBounds);
                }
            }
View Full Code Here

        private final List<TypeInfo> supertypes;
        private final List<TypeInfo> interfaces;
        private final List<TypeInfo> superclasses;

        private Supertypes(ParameterizedTypeImpl parameterizedType) {
            RawTypeInfo rawType = parameterizedType.rawType;
            List<TypeInfo> rawSupertypes = rawType.getSupertypes();
            List<TypeInfo> rawInterfaces = rawType.getInterfaces();
            List<TypeInfo> rawSuperclasses = rawType.getSuperclasses();

            List<TypeInfo> supertypes = createArrayList(rawSupertypes.size());
            List<TypeInfo> interfaces = createArrayList(rawInterfaces.size());
            List<TypeInfo> superclasses = createArrayList(rawSuperclasses.size());
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.generictype.RawTypeInfo

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.