Package com.alibaba.citrus.generictype

Examples of com.alibaba.citrus.generictype.TypeInfo


            TypeInfo[] resolvedArgs = new TypeInfo[vars.size()];
            boolean resolved = true;
            boolean changed = false;

            for (int i = 0; i < resolvedArgs.length; i++) {
                TypeInfo arg = actualArgs.get(i);
                TypeInfo resolvedArg = arg.resolve(context, includeBaseType);

                if (arg != resolvedArg) {
                    changed = true;
                }
View Full Code Here


        assertNotNull(contextClass, "contextClass");
        assertNotNull(parentClass, "parentClass");
        assertTrue(index < parentClass.getTypeParameters().length, "index out of bound");

        GenericDeclarationInfo context = factory.getGenericDeclaration(contextClass);
        TypeInfo param = factory.getType(parentClass.getTypeParameters()[index]);

        return param.resolve(context);
    }
View Full Code Here

        return resolve(context, true);
    }

    // Implementation of TypeInfo.resolve
    public TypeInfo resolve(GenericDeclarationInfo context, boolean includeBaseType) {
        TypeInfo resolvedComponentType = componentType.resolve(context, includeBaseType);

        if (resolvedComponentType == componentType) {
            return this;
        } else {
            return factory.getArrayType(resolvedComponentType, dimension);
View Full Code Here

            ARRAY_SUPERTYPES = arraySupertypes;
        }

        private Supertypes(ArrayTypeImpl arrayType) {
            TypeInfo componentType = arrayType.componentType;
            List<TypeInfo> componentSupertypes = componentType.getSupertypes();
            ArrayList<TypeInfo> supertypes = createArrayList(componentSupertypes.size() * 2);
            ArrayList<TypeInfo> interfaces = createArrayList();
            ArrayList<TypeInfo> superclasses = createArrayList();

            for (TypeInfo componentSupertype : componentSupertypes) {
View Full Code Here

                    || Error.class.isAssignableFrom(exception.getRawType())) {
                continue;
            }

            for (Iterator<TypeInfo> j = effectiveExceptions.iterator(); j.hasNext();) {
                TypeInfo existing = j.next();

                if (exception.getRawType().isAssignableFrom(existing.getRawType())) {
                    j.remove();
                } else if (existing.getRawType().isAssignableFrom(exception.getRawType())) {
                    exception = null;
                    break;
                }
            }
View Full Code Here

        TypeInfo[] exceptionTypes = new TypeInfo[this.exceptionTypes.size()];

        changed |= resolveTypes(this.parameterTypes, parameterTypes, context, includeBaseType);
        changed |= resolveTypes(this.exceptionTypes, exceptionTypes, context, includeBaseType);

        TypeInfo returnType = this.returnType.resolve(context, includeBaseType);

        if (returnType != this.returnType) {
            changed = true;
        }
View Full Code Here

    private boolean resolveTypes(List<TypeInfo> types, TypeInfo[] resolvedTypes, GenericDeclarationInfo context,
                                 boolean includeBaseType) {
        boolean changed = false;

        for (int i = 0; i < resolvedTypes.length; i++) {
            TypeInfo type = types.get(i);
            TypeInfo resolvedType = type.resolve(context, includeBaseType);

            if (type != resolvedType) {
                changed = true;
            }
View Full Code Here

    }

    public TypeInfo getPrimitiveWrapperType() {
        if (isPrimitive()) {
            String name = getRawType().getName();
            TypeInfo wrapperType = PRIMITIVE_WRAPPERS.get(name);

            return assertNotNull(wrapperType, "Unknown primitive type: %s", name);
        }

        return this;
View Full Code Here

                    if (type == null) {
                        break;
                    }

                    TypeInfo typeInfo = factory.getType(type);

                    supertypes.add(typeInfo);
                    rawClass = typeInfo.getRawType();
                }
            }

            // interfaces
            int interfaceCount;

            for (interfaceCount = 0; !interfaceQueue.isEmpty(); interfaceCount++) {
                type = interfaceQueue.pop();

                TypeInfo typeInfo = factory.getType(type);

                supertypes.add(typeInfo);
                rawClass = typeInfo.getRawType();
                interfaceQueue.push(rawClass.getGenericInterfaces());
            }

            // Object
            if (hasObject) {
View Full Code Here

    public FieldInfo resolve(GenericDeclarationInfo context) {
        return resolve(context, true);
    }

    public FieldInfo resolve(GenericDeclarationInfo context, boolean includeBaseType) {
        TypeInfo resolvedType = type.resolve(context, includeBaseType);

        if (type != resolvedType) {
            return new FieldImpl(field, declaringType, resolvedType);
        } else {
            return this;
View Full Code Here

TOP

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

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.