Examples of ExcelCollection


Examples of org.jeecgframework.poi.excel.annotation.ExcelCollection

      // 先判断是不是collection,在判断是不是java自带对象,之后就是我们自己的对象了
      if (ExcelPublicUtil.isNotUserExcelUserThis(field, targetId)) {
        continue;
      }
      if (ExcelPublicUtil.isCollection(field.getType())) {
        ExcelCollection excel = field
            .getAnnotation(ExcelCollection.class);
        ParameterizedType pt = (ParameterizedType) field
            .getGenericType();
        Class<?> clz = (Class<?>) pt.getActualTypeArguments()[0];
        List<ExcelExportEntity> list = new ArrayList<ExcelExportEntity>();
        getExcelFieldList(targetId,
            ExcelPublicUtil.getClassFields(clz), clz, list, null);
        excelEntity = new ExcelExportEntity();
        excelEntity.setName(getExcelName(excel.exportName(), targetId));
        excelEntity
            .setOrderNum(getCellOrder(excel.orderNum(), targetId));
        excelEntity.setGetMethod(ExcelPublicUtil.getMethod(
            field.getName(), pojoClass));
        excelEntity.setList(list);
        excelParams.add(excelEntity);
      } else if (ExcelPublicUtil.isJavaClass(field)) {
        Excel excel = field.getAnnotation(Excel.class);
        excelEntity = new ExcelExportEntity();
        excelEntity.setType(excel.exportType());
        getExcelField(targetId, field, excelEntity, excel, pojoClass);
        if (getMethods != null) {
          List<Method> newMethods = new ArrayList<Method>();
          newMethods.addAll(getMethods);
          newMethods.add(excelEntity.getGetMethod());
View Full Code Here

Examples of org.jeecgframework.poi.excel.annotation.ExcelCollection

      obj = clazz.newInstance();
      Field[] fields = getClassFields(clazz);
      for(Field field:fields){
        if(isNotUserExcelUserThis(field, targetId)){continue;}
        if(isCollection(field.getType())){
          ExcelCollection collection = field
              .getAnnotation(ExcelCollection.class);
          fieldname = field.getName();
          setMethod = getMethod(fieldname,clazz,field.getType());
          setMethod.invoke(obj,ExcelPublicUtil.class.getClassLoader().loadClass(collection.type()).newInstance());
        }else if(!isJavaClass(field)){
          fieldname = field.getName();
          setMethod = getMethod(fieldname,clazz,field.getType() );
          setMethod.invoke(obj, createObject(field.getType(),targetId));
        }
View Full Code Here

Examples of org.jeecgframework.poi.excel.annotation.ExcelCollection

    for (int i = 0; i < fields.length; i++) {
      Field field = fields[i];
      // 先判断是不是collection,在判断是不是java自带对象,之后就是我们自己的对象了
      if(ExcelPublicUtil.isNotUserExcelUserThis(field, targetId)){continue;}
      if (ExcelPublicUtil.isCollection(field.getType())) {
        ExcelCollection excel = field
            .getAnnotation(ExcelCollection.class);
        ParameterizedType pt = (ParameterizedType) field
            .getGenericType();
        Class<?> clz = (Class<?>) pt.getActualTypeArguments()[0];
        List<ExcelExportEntity> list = new ArrayList<ExcelExportEntity>();
        getExcelFieldList(targetId, ExcelPublicUtil.getClassFields(clz), clz,
            list, null);
        excelEntity = new ExcelExportEntity();
        excelEntity.setName(getExcelName(excel.exportName(),
            targetId));
        excelEntity.setOrderNum(getCellOrder(excel.orderNum(), targetId));
        excelEntity.setGetMethod(ExcelPublicUtil.getMethod(field.getName(),
            pojoClass));
        excelEntity.setList(list);
        excelParams.add(excelEntity);
      } else if (ExcelPublicUtil.isJavaClass(field)) {
        Excel excel = field.getAnnotation(Excel.class);
        excelEntity = new ExcelExportEntity();
        excelEntity.setType(excel.exportType());
        getExcelField(targetId, field, excelEntity, excel,
            pojoClass);
        if (getMethods != null) {
          List<Method> newMethods = new ArrayList<Method>();
          newMethods.addAll(getMethods);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.