本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
}