if(ClassUtil.isParametrizedType(genericType))
{
if(!ClassUtil.checkParametrizedType((ParameterizedType)genericType))
{
throw new WebBeansConfigurationException("Producer annotated field : " + annotatedField + " can not be Wildcard type or Type variable");
}
}
Annotation[] anns = AnnotationUtil.getAnnotationsFromSet(annotatedField.getAnnotations());
Field field = annotatedField.getJavaMember();
//Producer field for resource
Annotation resourceAnnotation = AnnotationUtil.hasOwbInjectableResource(anns);
//Producer field for resource
if(resourceAnnotation != null)
{
//Check for valid resource annotation
//WebBeansUtil.checkForValidResources(annotatedField.getDeclaringType().getJavaClass(), field.getType(), field.getName(), anns);
if(!Modifier.isStatic(field.getModifiers()))
{
ResourceReference<X,Annotation> resourceRef = new ResourceReference<X, Annotation>(bean.getBeanClass(), field.getName(),
(Class<X>)field.getType(), resourceAnnotation);
//Can not define EL name
if(annotatedField.isAnnotationPresent(Named.class))
{
throw new WebBeansConfigurationException("Resource producer annotated field : " + annotatedField + " can not define EL name");
}
ResourceBean<X,Annotation> resourceBean = new ResourceBean((Class<X>)field.getType(),bean, resourceRef);
resourceBean.getTypes().addAll(annotatedField.getTypeClosure());