カラム情報の検証と、部分的に読み込む場合のカラム情報を補足する。
@param beanType Beanのクラスタイプ
@param list カラム番号の昇順に並び変えられたカラム情報。
432679
protected void validateColumnAndSupplyPartialColumn(final Class<?> beanType, final List<ColumnMapping> list) {
        
        final Optional<CsvPartial> partialAnno = Optional.ofNullable(beanType.getAnnotation(CsvPartial.class));
        
        if(list.isEmpty()) {
            throw new SuperCsvInvalidAnnotationException(MessageBuilder.create("anno.notFound")
                    .varWithClass("property", beanType)
                    .varWithAnno("anno", CsvColumn.class)
                    .format());
        }
        
        // 番号の重複などのチェック
        BeanMappingFactoryHelper.validateDuplicatedColumnNumber(beanType, list);
        
        // 不足している番号のカラムを補完する。
        BeanMappingFactoryHelper.supplyLackedNumberMappingColumn(beanType, list, partialAnno, new String[0]);
        
    }
1221243
private void writeBean(Bean bean, Class<?> declaredType, RootType rootTypeFlag) throws IOException {
        output.writeObjectStart();
        // type information
        if (rootTypeFlag == RootType.ROOT_WITH_TYPE || (rootTypeFlag == RootType.NOT_ROOT && bean.getClass() != declaredType)) {
            String typeStr = SerTypeMapper.encodeType(bean.getClass(), settings, basePackage, knownTypes);
            if (rootTypeFlag == RootType.ROOT_WITH_TYPE) {
                basePackage = bean.getClass().getPackage().getName() + ".";
            }
            output.writeObjectKeyValue(BEAN, typeStr);
        }
        // property information
        for (MetaProperty<?> prop : bean.metaBean().metaPropertyIterable()) {
            if (prop.style().isSerializable() || (prop.style().isDerived() && settings.isIncludeDerived())) {
                Object value = SerOptional.extractValue(prop, bean);
                if (value != null) {
                    output.writeObjectKey(prop.name());
                    Class<?> propType = SerOptional.extractType(prop, bean.getClass());
                    if (value instanceof Bean) {
                        if (settings.getConverter().isConvertible(value.getClass())) {
                            writeSimple(propType, value);
                        } else {
                            writeBean((Bean) value, propType, RootType.NOT_ROOT);
                        }
                    } else {
                        SerIterator itemIterator = settings.getIteratorFactory().create(value, prop, bean.getClass());
                        if (itemIterator != null) {
                            writeElements(itemIterator);
                        } else {
                            writeSimple(propType, value);
                        }
                    }
                }
            }
        }
        output.writeObjectEnd();
    }
330846
public <T> boolean write(List<T> list, Class<T> clazz) {
		
		List<Object[]> rows = ExcelBeanHelper.beanToExcelValueArrays(list, clazz);
		try {
			Sheet sheet = workbook.getSheetAt(0);
			for (int i = 2; i < rows.size(); i++) {
				Row excelRow = sheet.getRow(i);
				Object[] vals = rows.get(i);
				for (int j = 0; j < vals.length; j++) {
					Cell cell = excelRow.getCell(j);
					cell.setCellValue(vals[j] == null ? "" : vals[j].toString());
				}
			}
			workbook.write(outputStream);
			return true;
		} catch (IOException e) {
			LOG.error("流异常", e);
		} catch (Exception e) {
			LOG.error("其他异常", e);
		} 
		return false;
	}
1228995
public <T> T getBean(Class<T> beanType) throws BeansException {
        return beanType.cast(BeanFactoryUtils.beanOfTypeIncludingAncestors(this, beanType));
    }
944561
public static TreeSet<Integer> supplyLackedNumberMappingColumn(final Class<?> beanType, final List<ColumnMapping> list,
            final Optional<CsvPartial> partialAnno, final String[] suppliedHeaders) {
        
        final TreeSet<Integer> checkedNumber = list.stream()
                .filter(col -> col.isDeterminedNumber())
                .map(col -> col.getNumber())
                .collect(Collectors.toCollection(TreeSet::new));
        
        // 定義されている列番号の最大値
        final int maxColumnNumber = checkedNumber.last();
        
        // Beanに定義されていない欠けているカラム番号の取得
        final TreeSet<Integer> lackedNumbers = new TreeSet<Integer>();
        for(int i=1; i <= maxColumnNumber; i++) {
            if(!checkedNumber.contains(i)) {
                lackedNumbers.add(i);
            }
        }
        
        // 定義されているカラム番号より、大きなカラム番号を持つカラム情報の補足
        if(partialAnno.isPresent()) {
            
            final int partialColumnSize = partialAnno.get().columnSize();
            if(maxColumnNumber > partialColumnSize) {
                throw new SuperCsvInvalidAnnotationException(partialAnno.get(), MessageBuilder.create("anno.CsvPartial.columSizeMin")
                        .var("property", beanType.getName())
                        .var("columnSize", partialColumnSize)
                        .var("maxColumnNumber", maxColumnNumber)
                        .format());
                
            }
            
            if(maxColumnNumber < partialColumnSize) {
                for(int i= maxColumnNumber+1; i <= partialColumnSize; i++) {
                    lackedNumbers.add(i);
                }
            }
            
        }
        
        // 不足分のカラムがある場合は、部分的な読み書き用カラムとして追加する
        if(lackedNumbers.size() > 0) {
            
            for(int number : lackedNumbers) {
                list.add(createPartialColumnMapping(number, partialAnno, getSuppliedHeaders(suppliedHeaders, number)));
            }
            
            list.sort(null);
        }
        
        return lackedNumbers;
        
    }
687373
public static <T> List<T> queryBeanList(String sql, Class<T> beanType, Object[] params)
      throws YankSQLException {

    return queryBeanList(YankPoolManager.DEFAULT_POOL_NAME, sql, beanType, params);
  }
1044684
public void write(Bean bean, boolean rootType, Appendable output) throws IOException {
        if (bean == null) {
            throw new NullPointerException("bean");
        }
        this.output = output;
        this.rootBean = bean;
        this.basePackage = (rootType ? bean.getClass().getPackage().getName() + "." : null);
        
        String type = rootBean.getClass().getName();
        writeHeader();
        output.append('<').append(BEAN);
        if (rootType) {
            appendAttribute(output, TYPE, type);
        }
        output.append('>').append(settings.getNewLine());
        writeBean(rootBean, settings.getIndent());
        output.append('<').append('/').append(BEAN).append('>').append(settings.getNewLine());
    }
1305810
public T executeFrom(Object bean) {
    List<T> executeFromCollectionResult = executeFrom(Collections.singleton(bean));
    if (CollectionUtils.isEmpty(executeFromCollectionResult)) {
      return null;
    } else {
      return executeFromCollectionResult.get(0);
    }
  }
224677
public static <T> List<T> copy(final List<T> list) {
		if (list == null) {
			return null;
		}

		TypeEnum elementType = null;
		List<T> copy = new ArrayList<T>();
		for (T element : list) {
			T elementCopy = null;
			if (element != null) {
				if (elementType == null) {
					elementType = TypeEnum.dataTypeOf(element.getClass());
				}
				elementCopy = copy(element, elementType);
			}

			copy.add(elementCopy);
		}

		return copy;
	}
1180894
public void applyTo(List<String> list)
    {
        for(int i = 0; i < list.size(); i++)
            list.set(i, stem(list.get(i)));
    }
560029
@Override
    public void setBean(Class<?> type, Object proxyBean) {
        BeanDefine beanDefine = pool.get(type.getName());
        if (beanDefine != null) {
            beanDefine.setBean(proxyBean);
        } else {
            beanDefine = new BeanDefine(proxyBean, type);
        }
        pool.put(type.getName(), beanDefine);
    }
548069
public static void mapping(Object src, Object target) throws BeanMappingException {
        BeanMapping mapping = BeanMapping.create(src.getClass(), target.getClass());
        mapping.mapping(src, target);
    }
413514
public static final <T> T assignList(Object bean, String property, String hint, BiFunction<Class<T>,String,T> factory)
    {
        Class[] pt = getParameterTypes(bean, prefix(property));
        Class type = pt != null && pt.length > 0 ? pt[0] : null;
        T value = (T) factory.apply(type, hint);
        doFor(
            bean, 
            property, 
            null,
            (Object a, int i)->{Array.set(a, i, value);return null;},
            (List l, int i)->{l.set(i, value);return null;},
            (Object b, Class c, String p)->{throw  new UnsupportedOperationException("not supported");},
            (Object b, Method m)->{throw  new UnsupportedOperationException("not supported");}
        );
        return value;
    }
1239255
protected void writeObjectHeader(List<Object> list) {
        // action
        list.add("{\"" + getOperation() + "\":{");

        // flag indicating whether a comma needs to be added between fields
        boolean commaMightBeNeeded = false;

        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.INDEX, indexExtractor), "", commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TYPE, typeExtractor), "\"_type\":", commaMightBeNeeded);
        commaMightBeNeeded = id(list, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.PARENT, parentExtractor), requestParameterNames.parent, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValueAsFieldWriter(list, getMetadataExtractorOrFallback(Metadata.ROUTING, routingExtractor), requestParameterNames.routing, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TTL, ttlExtractor), "\"_ttl\":", commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TIMESTAMP, timestampExtractor), "\"_timestamp\":", commaMightBeNeeded);

        // version & version_type fields
        Object versionField = getMetadataExtractorOrFallback(Metadata.VERSION, versionExtractor);
        if (versionField != null) {
            if (commaMightBeNeeded) {
                list.add(",");
                commaMightBeNeeded = false;
            }
            commaMightBeNeeded = true;
            list.add(requestParameterNames.version);
            list.add(versionField);

            // version_type - only needed when a version is specified
            Object versionTypeField = getMetadataExtractorOrFallback(Metadata.VERSION_TYPE, versionTypeExtractor);
            if (versionTypeField != null) {
                if (commaMightBeNeeded) {
                    list.add(",");
                    commaMightBeNeeded = false;
                }
                commaMightBeNeeded = true;
                list.add(requestParameterNames.versionType);
                list.add(versionTypeField);
            }
        }

        // useful for update command
        otherHeader(list, commaMightBeNeeded);
        list.add("}}\n");
    }
175501
private void addCallback(BeanMessageID type, Callback<?> callback) {
        List<Callback<?>> callbacks = beanCallbacks.get(type);
        if (callbacks == null) {
            callbacks = new ArrayList<>(16);
            beanCallbacks.put(type, callbacks);
        }
        callbacks.add(callback);
    }
879203
public <T> void beanClass(Class<T> beanClass)
  {
    validateBeanClass(beanClass);
    
    if (Modifier.isAbstract(beanClass.getModifiers())
        && ! abstractMethods(beanClass)) {
      throw error(L.l("abstract bean class '{0}' is invalid because the abstract methods can't be generated.",
                      beanClass.getSimpleName()));
    }
  }
787839
private Object manageListIfNecessary(List<Object> value) {
		boolean containsRuntimeRefs = false;
		for (ListIterator<Object> i = value.listIterator(); i.hasNext();) {
			Object e = i.next();
			if(e instanceof RuntimeBeanReference) {
				containsRuntimeRefs = true;
			}
            if (e instanceof BeanConfiguration) {
                BeanConfiguration c = (BeanConfiguration) e;
                i.set(c.getBeanDefinition());
                containsRuntimeRefs = true;
            }
        }
		if(containsRuntimeRefs) {
			List tmp = new ManagedList();
			tmp.addAll(value);
			value = tmp;
		}
		return value;
	}