当前位置: 首页>>代码示例>>Java>>正文


Java Utils.getMapColumnProperties方法代码示例

本文整理汇总了Java中net.java.amateras.xlsbeans.Utils.getMapColumnProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getMapColumnProperties方法的具体用法?Java Utils.getMapColumnProperties怎么用?Java Utils.getMapColumnProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.java.amateras.xlsbeans.Utils的用法示例。


在下文中一共展示了Utils.getMapColumnProperties方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processMapColumns

import net.java.amateras.xlsbeans.Utils; //导入方法依赖的package包/类
private void processMapColumns(WSheet sheet, List<HeaderInfo> headerInfos,
		int begin, int column, Object record, AnnotationReader reader) throws Exception {

	List<Object> properties = Utils.getMapColumnProperties(record, reader);

	for(Object property : properties){
		MapColumns ann = null;
		if(property instanceof Method){
			ann = reader.getAnnotation(record.getClass(), (Method) property, MapColumns.class);
		} else if(property instanceof Field){
			ann = reader.getAnnotation(record.getClass(), (Field) property, MapColumns.class);
		}

		boolean flag = false;
		Map<String, String> map = new LinkedHashMap<String, String>();
		for(HeaderInfo headerInfo : headerInfos){
			if(headerInfo.getHeaderLabel().equals(ann.previousColumnName())){
				flag = true;
				begin++;
				continue;
			}
			if(flag){
				WCell cell = sheet.getCell(column, begin + headerInfo.getHeaderRange());
				map.put(headerInfo.getHeaderLabel(), cell.getContents());
			}
			begin = begin + headerInfo.getHeaderRange() + 1;
		}

		if(property instanceof Method){
			((Method) property).invoke(record, map);
		} else if(property instanceof Field){
			((Field) property).set(record, map);
		}
	}
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:36,代码来源:VerticalRecordsProcessor.java

示例2: processMapColumns

import net.java.amateras.xlsbeans.Utils; //导入方法依赖的package包/类
private void processMapColumns(WSheet wSheet, List<HeaderInfo> headerInfos,
		int begin, int row, Object record, AnnotationReader reader) throws Exception {

	List<Object> properties = Utils.getMapColumnProperties(record, reader);

	for(Object property : properties){
		MapColumns ann = null;
		if(property instanceof Method){
			ann = reader.getAnnotation(record.getClass(), (Method) property, MapColumns.class);
		} else if(property instanceof Field){
			ann = reader.getAnnotation(record.getClass(), (Field) property, MapColumns.class);
		}

		boolean flag = false;
		Map<String, String> map = new LinkedHashMap<String, String>();
		for(HeaderInfo headerInfo : headerInfos){
			if(headerInfo.getHeaderLabel().equals(ann.previousColumnName())){
				flag = true;
				begin++;
				continue;
			}
			if(flag){
				WCell cell = wSheet.getCell(begin + headerInfo.getHeaderRange(), row);
				map.put(headerInfo.getHeaderLabel(), cell.getContents());
			}
			begin = begin + headerInfo.getHeaderRange() + 1;
		}

		if(property instanceof Method){
			((Method) property).invoke(record, map);
		} else if(property instanceof Field){
			((Field) property).set(record, map);
		}
	}
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:36,代码来源:HorizontalRecordsProcessor.java

示例3: processMapColumns

import net.java.amateras.xlsbeans.Utils; //导入方法依赖的package包/类
private void processMapColumns(WSheet sheet, List<HeaderInfo> headerInfos,
		int begin, int column, Object record, AnnotationReader reader, XLSBeansConfig config) throws Exception {

	List<Object> properties = Utils.getMapColumnProperties(record, reader);

	for(Object property : properties){
		MapColumns ann = null;
		if(property instanceof Method){
			ann = reader.getAnnotation(record.getClass(), (Method) property, MapColumns.class);
		} else if(property instanceof Field){
			ann = reader.getAnnotation(record.getClass(), (Field) property, MapColumns.class);
		}

		boolean flag = false;
		Map<String, String> map = new LinkedHashMap<String, String>();
		for(HeaderInfo headerInfo : headerInfos){
               if(Utils.matches(headerInfo.getHeaderLabel(), ann.previousColumnName(), config)){
				flag = true;
				begin++;
				continue;
			}
			if(flag){
				WCell cell = sheet.getCell(column, begin + headerInfo.getHeaderRange());
				map.put(headerInfo.getHeaderLabel(), cell.getContents());
			}
			begin = begin + headerInfo.getHeaderRange() + 1;
		}

		if(property instanceof Method){
			((Method) property).invoke(record, map);
		} else if(property instanceof Field){
			((Field) property).set(record, map);
		}
	}
}
 
开发者ID:takezoe,项目名称:xlsbeans,代码行数:36,代码来源:VerticalRecordsProcessor.java

示例4: processMapColumns

import net.java.amateras.xlsbeans.Utils; //导入方法依赖的package包/类
private void processMapColumns(WSheet wSheet, List<HeaderInfo> headerInfos,
		int begin, int row, Object record, AnnotationReader reader, XLSBeansConfig config) throws Exception {

	List<Object> properties = Utils.getMapColumnProperties(record, reader);

	for(Object property : properties){
		MapColumns ann = null;
		if(property instanceof Method){
			ann = reader.getAnnotation(record.getClass(), (Method) property, MapColumns.class);
		} else if(property instanceof Field){
			ann = reader.getAnnotation(record.getClass(), (Field) property, MapColumns.class);
		}

		boolean flag = false;
		Map<String, String> map = new LinkedHashMap<String, String>();
		for(HeaderInfo headerInfo : headerInfos){
               if(Utils.matches(headerInfo.getHeaderLabel(), ann.previousColumnName(), config)){
                   flag = true;
                   begin++;
                   continue;
               }
			if(flag){
				WCell cell = wSheet.getCell(begin + headerInfo.getHeaderRange(), row);
				map.put(headerInfo.getHeaderLabel(), cell.getContents());
			}
			begin = begin + headerInfo.getHeaderRange() + 1;
		}

		if(property instanceof Method){
			((Method) property).invoke(record, map);
		} else if(property instanceof Field){
			((Field) property).set(record, map);
		}
	}
}
 
开发者ID:takezoe,项目名称:xlsbeans,代码行数:36,代码来源:HorizontalRecordsProcessor.java

示例5: processMapColumns

import net.java.amateras.xlsbeans.Utils; //导入方法依赖的package包/类
/**
 * <p>
 * {@link Column}アノテーションが付与されているプロパティを検索し、Excelのデータとマッピングします。
 * </p>
 */
protected void processMapColumns(WSheet sheet, List<JxHeaderInfo> headerInfos, int begin, int column, Object record,
    AnnotationReader reader) throws Exception {

    List<Object> properties = Utils.getMapColumnProperties(record, reader);
    for (Object property : properties) {
        MapColumns ann = null;
        if (property instanceof Method) {
            ann = reader.getAnnotation(record.getClass(), (Method) property, MapColumns.class);
        } else if (property instanceof Field) {
            ann = reader.getAnnotation(record.getClass(), (Field) property, MapColumns.class);
        }
        boolean flag = false;
        Map<String, String> map = new LinkedHashMap<String, String>();
        for (JxHeaderInfo headerInfo : headerInfos) {
            if (headerInfo.getHeaderLabel().equals(ann.previousColumnName())) {
                flag = true;
                begin++;
                continue;
            }
            if (flag) {
                WCell cell = sheet.getCell(column, begin + headerInfo.getHeaderRange());
                map.put(headerInfo.getHeaderLabel(), cell.getContents());
            }
            begin = begin + headerInfo.getHeaderRange() + 1;
        }
        if (!map.isEmpty()) {
            if (property instanceof Method) {
                ((Method) property).invoke(record, map);
            } else if (property instanceof Field) {
                ((Field) property).set(record, map);
            }
        }
    }
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:40,代码来源:JxVerticalRecordsProcessor.java


注:本文中的net.java.amateras.xlsbeans.Utils.getMapColumnProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。