处理的数据是集合类型
<p>Function: createValueList</p>
<p>Description: </p>
@author acexy@thankjava.com
@date 2015-1-27 下午4:59:12
@version 1.0
@param targetFieldType
@param targetObject
@param originValue
@return
@throws ClassNotFoundException
963656
static Object createValueList(Field targetField,Class<?> targetFieldType,Object targetObject,Object originValue) {
		if(originValue == null){
			return null;
		}
		
		List<?> originList = (List<?>)originValue;
		if(originList.size() == 0){
			return null;
		}
		
		Class<?> proxyType = originList.get(0).getClass();

//		Type type = targetField.getGenericType();
//		Type[] types = (Type[]) ReflectUtil.getFieldVal(type, "actualTypeArguments");
//		System.out.println(types);
//		Class<?> proxyType = null;
//		try {
//			System.out.println(ReflectUtil.getFieldVal(types[0], "name").toString());
//			proxyType = Class.forName(ReflectUtil.getFieldVal(types[0], "name").toString());
//		} catch (ClassNotFoundException e) {
//			e.printStackTrace();
//			return null;
//		}
		
		
		List<Object> targetList = new ArrayList<Object>();
		
		for (Object object : originList) {
			targetList.add(ValueCast.createValueCore(targetField, proxyType, targetList, object));
		}
		return targetList;
		
	}
134940
@VisibleForTesting
  static TypedValue createTypedValue(Value value) {
    return value.match(
        typedValueDoubleFunction,
        typedValueLongFunction,
        typedValueDistributionFunction,
        typedValueSummaryFunction,
        Functions.<TypedValue>throwIllegalArgumentException());
  }
500290
private <T extends ValueDescriptor<?>> T createValue(Class<T> type, String name) {
        if (name != null) {
            this.arrayValueDescriptor = null;
        }
        String valueName;
        if (arrayValueDescriptor != null) {
            valueName = "[" + getArrayValue().size() + "]";
        } else {
            valueName = name;
        }
        T valueDescriptor = visitorHelper.getValueDescriptor(type);
        valueDescriptor.setName(valueName);
        return valueDescriptor;
    }
259964
public void setValue(final Object targetObj, final Object value) {
        ArgUtils.notNull(targetObj, "targetObj");
        
        if(targetSetter.isPresent()) {
            try {
                targetSetter.get().invoke(targetObj, value);
            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                throw new FieldAccessException(this, "fail setter value", e);
            }
            
        } else if(targetField.isPresent()) {
            try {
                targetField.get().set(targetObj, value);
                
            } catch (IllegalArgumentException | IllegalAccessException e) {
                throw new FieldAccessException(this, "fail setter field value", e);
            }
            
        } else {
            throw new FieldAccessException(this, "not found setter method or field.");
        }
    }
297619
public static void setField(Class<?> type, String fieldName, Object fieldValue) {
		setField(null, type, fieldName, fieldValue);
	}
580101
public Object getValue(final Object targetObj) {
        
        ArgUtils.notNull(targetObj, "targetObj");
        
        if(targetGetter.isPresent()) {
            try {
                return targetGetter.get().invoke(targetObj);
            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                throw new FieldAccessException(this, "fail getter value", e);
            }
            
        } else if(targetField.isPresent()) {
            try {
                return targetField.get().get(targetObj);
            } catch (IllegalArgumentException | IllegalAccessException e) {
                throw new FieldAccessException(this, "fail get field value", e);
            }
            
        } else {
            throw new FieldAccessException(this, "not found getter method or field.");
        }
        
    }
87394
def create_values(self, base_model=models.Model, base_manager=models.Manager):
        

        _builder = self

        class CustomContentTypeFieldValueManager(base_manager):
            def create(self, **kwargs):
                """
                Subclass create in order to be able to use "value" in kwargs
                instead of using "value_%s" passing also type directly
                """
                if 'value' in kwargs:
                    value = kwargs.pop('value')
                    created_object = super(CustomContentTypeFieldValueManager, self).create(**kwargs)
                    created_object.value = value
                    return created_object
                else:
                    return super(CustomContentTypeFieldValueManager, self).create(**kwargs)

        @python_2_unicode_compatible
        class CustomContentTypeFieldValue(base_model):
            custom_field = models.ForeignKey('.'.join(_builder.fields_model),
                                             verbose_name=_('custom field'),
                                             related_name='+')
            content_type = models.ForeignKey(ContentType, editable=False,
                                             verbose_name=_('content type'),
                                             limit_choices_to=_builder.content_types_query)
            object_id = models.PositiveIntegerField(_('object id'), db_index=True)
            content_object = GenericForeignKey('content_type', 'object_id')

            value_text = models.TextField(blank=True, null=True)
            value_integer = models.IntegerField(blank=True, null=True)
            value_float = models.FloatField(blank=True, null=True)
            value_time = models.TimeField(blank=True, null=True)
            value_date = models.DateField(blank=True, null=True)
            value_datetime = models.DateTimeField(blank=True, null=True)
            value_boolean = models.NullBooleanField(blank=True)

            objects = CustomContentTypeFieldValueManager()

            def _get_value(self):
                return getattr(self, 'value_%s' % self.custom_field.data_type)

            def _set_value(self, new_value):
                setattr(self, 'value_%s' % self.custom_field.data_type, new_value)

            value = property(_get_value, _set_value)

            class Meta:
                unique_together = ('custom_field', 'content_type', 'object_id')
                verbose_name = _('custom field value')
                verbose_name_plural = _('custom field values')
                abstract = True

            def save(self, *args, **kwargs):
                # save content type as user shouldn't be able to change it
                self.content_type = self.custom_field.content_type
                super(CustomContentTypeFieldValue, self).save(*args, **kwargs)

            def validate_unique(self, exclude=None):
                qs = self.__class__._default_manager.filter(
                    custom_field=self.custom_field,
                    content_type=self.custom_field.content_type,
                    object_id=self.object_id,
                )
                if not self._state.adding and self.pk is not None:
                    qs = qs.exclude(pk=self.pk)
                if qs.exists():
                    raise ValidationError({ NON_FIELD_ERRORS: (_('A value for this custom field already exists'),) })

            def __str__(self):
                return "%s: %s" % (self.custom_field.name, self.value)

        return CustomContentTypeFieldValue
1217982
public Object convert(Class<?> targetType, Object value) {
        if (value == null) {
            return null;
        }

        Converter converter = getConverter(value.getClass(), targetType);
        if (converter == null) {
            throw new IllegalArgumentException(
                    "No converter from " + value.getClass() + " to " + targetType.getName());
        } else {
            return converter.convert(targetType, value);
        }
    }
1022562
public <T> T to(Class<T> targetType) {
        if (targetType == String.class) {
            return (T) value;
        }
        try {
            final String methodName;
            final Class type;
            if (targetType.isPrimitive()) {
                final String typeName = targetType.getSimpleName();
                methodName = "parse" + typeName.substring(0, 1).toUpperCase() + typeName.substring(1);
                type = PRIMITIVE_TO_OBJECT_TYPE_MAP.get(targetType);
            } else {
                methodName = "valueOf";
                type = targetType;
            }
            return (T) type.getMethod(methodName, String.class).invoke(null, value);
        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
            throw new RuntimeException("Could not convert value '" + value + "' to type " + targetType.getName(), e);
        }
    }
369415
private void populate(Field field, Object target, String stringValue) {
        field.setAccessible(true);
        try {
            final Class fieldType = field.getType();
            final Object value = TypeConverter.convert(stringValue).to(fieldType);
            field.set(target, value);
        } catch (IllegalAccessException e) {
            throw new RuntimeException("Could not populate field " + field, e);
        }
    }
1044537
protected void createValueLocal(LocalIndices localIndices, MethodVisitor mv, Field f) {
        visitGetter(mv, f);
        localIndices.incrementAndSetOriginalLocalIndex();

        mv.visitVarInsn(storeOpCode(f.getType()), localIndices.getLocalIndex());
        mv.visitVarInsn(loadOpCode(f.getType()), localIndices.getLocalIndex());
        AsmValidators.processWideLocal(f.getType(), localIndices);

        if (f.getType() == String.class) return;
        if (f.getType().isPrimitive()) {
            localIndices.setOriginalPrimitive(true);

            mv.visitMethodInsn(INVOKESTATIC, p(String.class), "valueOf", sig(String.class, f.getType()), false);

            localIndices.incrementAndSetStringLocalIndex();

            mv.visitVarInsn(ASTORE, localIndices.getLocalIndex());
            mv.visitVarInsn(ALOAD, localIndices.getLocalIndex());
            return;
        }

    }
49985
private static void _addValueGetter (@Nonnull final Outline aOutline,
                                       @Nonnull final Map <JClass, JType> aAllCtorClasses)
  {
    final JCodeModel aCodeModel = aOutline.getCodeModel ();
    // For all generated classes
    for (final ClassOutline aClassOutline : aOutline.getClasses ())
    {
      // Get the implementation class
      final JDefinedClass jClass = aClassOutline.implClass;
      // For all methods in the class (copy!)
      for (final JMethod aMethod : new CommonsArrayList <> (jClass.methods ()))
        if (aMethod.name ().startsWith ("get") && aMethod.params ().isEmpty ())
        {
          final JType aReturnType = aMethod.type ();
          final JType aValueType = aAllCtorClasses.get (aReturnType);
          if (aValueType != null)
          {
            final boolean bIsBoolean = aValueType == aCodeModel.BOOLEAN;
            final String sMethodName;
            if (bIsBoolean)
              sMethodName = "is" + aMethod.name ().substring (3) + "Value";
            else
              sMethodName = aMethod.name () + "Value";
            if (_containsMethodWithoutParams (jClass.methods (), sMethodName))
            {
              // This can happen if an XSD contains the element "X" and
              // "XValue" in the same type.
              // Noticed in CII D16B for BasicWorkItemType with "Index" and
              // "IndexValue" elements
              LOGGER.error ("Another method with name '" +
                            sMethodName +
                            "' and no parameters is already present in class '" +
                            jClass.name () +
                            "' - not creating it.");
              continue;
            }

            // The return type is a generated class
            if (aValueType.isPrimitive ())
            {
              final JMethod aGetter;
              final JVar aParam;
              if (bIsBoolean)
              {
                // Create the boolean is...Value() method
                aGetter = jClass.method (JMod.PUBLIC, aValueType, sMethodName);
                aParam = aGetter.param (JMod.FINAL, aValueType, "nullValue");
                final JVar aObj = aGetter.body ().decl (aReturnType, "aObj", JExpr.invoke (aMethod));
                aGetter.body ()._return (JOp.cond (aObj.eq (JExpr._null ()), aParam, aObj.invoke ("isValue")));
              }
              else
              {
                // Create the byte/char/double/float/int/long/short
                // get...Value() method
                aGetter = jClass.method (JMod.PUBLIC, aValueType, sMethodName);
                aParam = aGetter.param (JMod.FINAL, aValueType, "nullValue");
                final JVar aObj = aGetter.body ().decl (aReturnType, "aObj", JExpr.invoke (aMethod));
                aGetter.body ()._return (JOp.cond (aObj.eq (JExpr._null ()), aParam, aObj.invoke ("getValue")));
              }

              // Javadoc
              aGetter.javadoc ().add ("Get the value of the contained " + aReturnType.name () + " object");
              aGetter.javadoc ()
                     .addParam (aParam)
                     .add ("The value to be returned, if the owning object is <code>null</code>");
              aGetter.javadoc ()
                     .addReturn ()
                     .add ("Either the value of the contained " +
                           aReturnType.name () +
                           " object or the passed " +
                           aParam.name ());
              aGetter.javadoc ().add (AUTHOR);
            }
            else
            {
              // Create the Object get...Value() method
              final JMethod aGetter = jClass.method (JMod.PUBLIC, aValueType, sMethodName);
              aGetter.annotate (Nullable.class);
              final JVar aObj = aGetter.body ().decl (aReturnType, "aObj", JExpr.invoke (aMethod));
              aGetter.body ()._return (JOp.cond (aObj.eq (JExpr._null ()), JExpr._null (), aObj.invoke ("getValue")));
              aGetter.javadoc ().add ("Get the value of the contained " + aReturnType.name () + " object");
              aGetter.javadoc ()
                     .addReturn ()
                     .add ("Either the value of the contained " + aReturnType.name () + " object or <code>null</code>");
              aGetter.javadoc ().add (AUTHOR);
            }
          }
        }
    }
  }
205580
public BeanBox injectValue(String fieldName, Object constValue) {
		checkOrCreateFieldInjects();
		Field f = ReflectionUtils.findField(beanClass, fieldName);
		BeanBox inject = new BeanBox();
		inject.setTarget(constValue);
		inject.setType(f.getType());
		inject.setPureValue(true);
		ReflectionUtils.makeAccessible(f);
		this.getFieldInjects().put(f, inject);
		return this;
	}
661234
public static <T extends Object> T setFieldValue(Object obj, Field field, T fieldValue) {
        Assert.notNull(obj, "obj不能为空");
        Assert.notNull(field, "field不能为空");

        try {
            field.set(obj, fieldValue);
        } catch (IllegalAccessException e) {
            String msg = StringUtils.format("类型[{0}]的字段[{1}]不允许设置", obj.getClass(),
                field.getName());
            log.error(msg);
            throw new ReflectException(msg, e);
        }
        return fieldValue;
    }
732604
public static <F, T> OrikaCopier.Builder<F, T> createOrika(Class<F> sourceClass, Class<T> targetClass) {
        return new OrikaCopier.Builder<>(sourceClass, targetClass);
    }
27549
static Converter getValueTypeConverter(FacesContext facesContext, UISelectMany component)
    {
        Converter converter = null;
        
        Object valueTypeAttr = component.getAttributes().get(VALUE_TYPE_KEY);
        if (valueTypeAttr != null)
        {
            // treat the valueType attribute exactly like the collectionType attribute
            Class<?> valueType = getClassFromAttribute(facesContext, valueTypeAttr);
            if (valueType == null)
            {
                throw new FacesException(
                        "The attribute "
                                + VALUE_TYPE_KEY
                                + " of component "
                                + component.getClientId(facesContext)
                                + " does not evaluate to a "
                                + "String, a Class object or a ValueExpression pointing "
                                + "to a String or a Class object.");
            }
            // now we have a valid valueType
            // --> try to get a registered-by-class converter
            converter = facesContext.getApplication().createConverter(valueType);
            
            if (converter == null)
            {
                facesContext.getExternalContext().log("Found attribute valueType on component " +
                        _ComponentUtils.getPathToComponent(component) +
                        ", but could not get a by-type converter for type " + 
                        valueType.getName());
            }
        }
        
        return converter;
    }
671523
@SuppressWarnings({ "unchecked", "rawtypes" })
	static Object createValueEnum(Field targetField,Class<?> targetFieldType,Object targetObject,Object originValue){
		if(originValue == null){
			return null;
		}
		Object enumNameObj = ReflectUtil.getFieldVal(originValue,"name");//获取枚举中的name属性
		if(enumNameObj == null){
			return null;
		}
		String enumName = (String)enumNameObj;
		return Enum.valueOf((Class<Enum>)targetFieldType,enumName);//得到目标枚举对象
	}