Examples of OwbParametrizedTypeImpl


Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

        }
       
        set.add(clazz);
        if(ClassUtil.isDefinitionConstainsTypeVariables(raw))
        {
            set.add(new OwbParametrizedTypeImpl(raw));
        }

        Type sc = raw.getGenericSuperclass();

        if (sc != null)
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            {
                resolvedTypeArguments = resolveTypes(parameterizedType.getActualTypeArguments(), actualType);

            }

            return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), parameterizedType.getRawType(), resolvedTypeArguments);
        }
        else if (type instanceof TypeVariable)
        {
            TypeVariable<?> variable = (TypeVariable<?>)type;
            return resolveTypeVariable(variable, actualType);
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            return (ParameterizedType)type;
        }
        else if (type instanceof Class)
        {
            Class<?> classType = (Class<?>)type;
            return new OwbParametrizedTypeImpl(classType.getDeclaringClass(), classType, classType.getTypeParameters());
        }
        else
        {
            throw new IllegalArgumentException(type.getClass().getSimpleName() + " is not supported");
        }
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

        }
        else if (actualClass.isAssignableFrom(declaringClass))
        {
            Class<?> directSubclass = getDirectSubclass(declaringClass, actualClass);
            Type[] typeArguments = resolveTypeArguments(directSubclass, actualType);
            Type directSubtype = new OwbParametrizedTypeImpl(directSubclass.getDeclaringClass(), directSubclass, typeArguments);
            return resolveTypeVariable(variable, directSubtype);
        }
        else // if (declaringClass.isAssignableFrom(actualClass))
        {
            Type genericSuperclass = getGenericSuperclass(actualClass, declaringClass);
            if (genericSuperclass == null)
            {
                return variable;
            }
            else if (genericSuperclass instanceof Class)
            {
                // special handling for type erasure
                Class<?> superclass = (Class<?>)genericSuperclass;
                genericSuperclass = new OwbParametrizedTypeImpl(superclass.getDeclaringClass(), superclass, getRawTypes(superclass.getTypeParameters()));
            }
            else
            {
                ParameterizedType genericSupertype = getParameterizedType(genericSuperclass);
                Type[] typeArguments = resolveTypeArguments(getParameterizedType(actualType), genericSupertype);
                genericSuperclass = new OwbParametrizedTypeImpl(genericSupertype.getOwnerType(), genericSupertype.getRawType(), typeArguments);
            }
            Type resolvedType = resolveTypeVariable(variable, genericSuperclass);
            if (resolvedType instanceof TypeVariable)
            {
                TypeVariable<?> resolvedTypeVariable = (TypeVariable<?>)resolvedType;
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

        {
            final Class<?> clazz = ClassUtil.getClass(beanClass);
            final Type toRemove;
            if (ClassUtil.isDefinitionContainsTypeVariables(beanClass))
            {
                final OwbParametrizedTypeImpl pt = new OwbParametrizedTypeImpl(clazz.getDeclaringClass(), clazz);
                final TypeVariable<?>[] tvs = clazz.getTypeParameters();
                for(TypeVariable<?> tv : tvs)
                {
                    pt.addTypeArgument(tv);
                }
                toRemove = pt;
                //X TODO generic support setDecoratorGenericType(pt);
            }
            else
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            {
                resolvedTypeArguments = resolveTypes(parameterizedType.getActualTypeArguments(), actualType);

            }

            return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), parameterizedType.getRawType(), resolvedTypeArguments);
        }
        else if (type instanceof TypeVariable)
        {
            TypeVariable<?> variable = (TypeVariable<?>)type;
            return resolveTypeVariable(variable, actualType);
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            return (ParameterizedType)type;
        }
        else if (type instanceof Class)
        {
            Class<?> classType = (Class<?>)type;
            return new OwbParametrizedTypeImpl(classType.getDeclaringClass(), classType, classType.getTypeParameters());
        }
        else
        {
            throw new IllegalArgumentException(type.getClass().getSimpleName() + " is not supported");
        }
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

        }
        else if (actualClass.isAssignableFrom(declaringClass))
        {
            Class<?> directSubclass = getDirectSubclass(declaringClass, actualClass);
            Type[] typeArguments = resolveTypeArguments(directSubclass, actualType);
            Type directSubtype = new OwbParametrizedTypeImpl(directSubclass.getDeclaringClass(), directSubclass, typeArguments);
            return resolveTypeVariable(variable, directSubtype);
        }
        else // if (declaringClass.isAssignableFrom(actualClass))
        {
            Type genericSuperclass = getGenericSuperclass(actualClass, declaringClass);
            if (genericSuperclass == null)
            {
                return variable;
            }
            else if (genericSuperclass instanceof Class)
            {
                // special handling for type erasure
                Class<?> superclass = (Class<?>)genericSuperclass;
                genericSuperclass = new OwbParametrizedTypeImpl(superclass.getDeclaringClass(), superclass, getRawTypes(superclass.getTypeParameters()));
            }
            else
            {
                ParameterizedType genericSupertype = getParameterizedType(genericSuperclass);
                Type[] typeArguments = resolveTypeArguments(getParameterizedType(actualType), genericSupertype);
                genericSuperclass = new OwbParametrizedTypeImpl(genericSupertype.getOwnerType(), genericSupertype.getRawType(), typeArguments);
            }
            Type resolvedType = resolveTypeVariable(variable, genericSuperclass);
            if (resolvedType instanceof TypeVariable)
            {
                TypeVariable<?> resolvedTypeVariable = (TypeVariable<?>)resolvedType;
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            {
                return selectType;
            }
            else if (rawType == List.class && type == ArrayList.class)
            {
                return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), type, parameterizedType.getActualTypeArguments());
            }
            else if (rawType == Set.class && type == HashSet.class)
            {
                return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), type, parameterizedType.getActualTypeArguments());
            }
            else if (rawType == Map.class && (type == HashMap.class || type == ConcurrentHashMap.class || type == TreeMap.class))
            {
                return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), type, parameterizedType.getActualTypeArguments());
            } // TODO: better handling of these kind of types, the idea is to check selectType is a parent of type and param number is ==
        }
        return type;
    }
View Full Code Here

Examples of org.apache.webbeans.config.OwbParametrizedTypeImpl

            {
                resolvedTypeArguments = resolveTypes(parameterizedType.getActualTypeArguments(), actualType);

            }

            return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), parameterizedType.getRawType(), resolvedTypeArguments);
        }
        else if (type instanceof TypeVariable)
        {
            TypeVariable<?> variable = (TypeVariable<?>)type;
            return resolveTypeVariable(variable, actualType);
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.