private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
            throws InstantiationException, IllegalAccessException, InvocationTargetException {

        List<FieldMetaData> mappingFields = objectMap.getFieldList();
        T obj = genericType.newInstance();
        for (int i = 0; i < mappingFields.size(); i++) {
            FieldMetaData field = mappingFields.get(i);
            // 设置属性值
            LOGGER.debug("设置值是 " + field + field.getValue(content, charset));
            BeanUtils.setProperty(obj, field.getFieldName(), field.getValue(content, charset));
        }

        return obj;
    }
private static < T > T mapByIndex ( byte [ ] content , Class < T > genericType , ObjectMetaData objectMap , Charset charset ) throws InstantiationException , IllegalAccessException , InvocationTargetException { List < FieldMetaData > mappingFields = objectMap . getFieldList ( ) ; T obj = genericType . newInstance ( ) ; for ( int i = 0 ; i < mappingFields . size ( ) ; i ++ ) { FieldMetaData field = mappingFields . get ( i ) ; LOGGER . debug ( "设置值是 " + field + field . getValue ( content , charset ) ) ; BeanUtils . setProperty ( obj , field . getFieldName ( ) , field . getValue ( content , charset ) ) ; } return obj ; }
按列顺序映射

@param content
@param genericType
@param objectMap
@return
@throws InstantiationException
@throws IllegalAccessException
@throws InvocationTargetException