Package loxia.utils

Examples of loxia.utils.OgnlStack


      if(definition.getExcelSheets().size() == 0 ||
        wb.getNumberOfSheets() < definition.getExcelSheets().size()){
        readStatus.setStatus(ReadStatus.STATUS_SETTING_ERROR);
        readStatus.setMessage("No sheet definition found or Sheet Number in definition is more than number in file.");
      }else{
        OgnlStack stack = new OgnlStack(beans);
        for(int i=0; i< definition.getExcelSheets().size(); i++){
          readSheet(wb,i,
              definition.getExcelSheets().get(i), stack, readStatus);
        }
      }
View Full Code Here


          if(beans.get(key) != null)
            cacheMap.put(key, new ArrayList<Object>());
        }
        for(int i = 0; i< wb.getNumberOfSheets(); i++){
          Map<String, Object> clonedBeans = cloneMap(beans);
          readSheet(wb,i, sheetDefinition, new OgnlStack(clonedBeans), readStatus);
          for(String key: clonedBeans.keySet())
            cacheMap.get(key).add(clonedBeans.get(key));
        }
        for(String key: beans.keySet()){
          if(cacheMap.containsKey(key)){
View Full Code Here

  }
 
  public ReadStatus readSheet(InputStream is, int sheetNo, Map<String, Object> beans) {
    ReadStatus readStatus = new DefaultReadStatus();
    readStatus.setStatus(ReadStatus.STATUS_SUCCESS);
    OgnlStack stack = new OgnlStack(beans);
    try {
      Workbook wb = WorkbookFactory.create(is);
      readSheet(wb,sheetNo,
          definition.getExcelSheets().iterator().next(),
          stack, readStatus);     
View Full Code Here

        }     
      }
      return result;
    }else{
      Object result = blockDefinition.getLoopClass().newInstance();   
      OgnlStack ognlStack = new OgnlStack(result);
      for(ExcelCell cellDefinition: blockDefinition.getCells()){   
        int rowOffSet = cellDefinition.getRow() - blockDefinition.getStartRow();
        Row row = sheet.getRow(startRow + rowOffSet);
        Cell cell = row == null ? null: row.getCell(cellDefinition.getCol());     
        try{
          Object value = getCellValue(cell,evaluator);
          value = checkValue(sheetNo, ExcelUtil.getCellIndex(startRow + rowOffSet ,cellDefinition.getCol()),
              value, cellDefinition,
              getPropertyType(result, cellDefinition));
          logger.debug("{}[Checked]:{}", ExcelUtil.getCellIndex(startRow + rowOffSet ,cellDefinition.getCol()), value);
          ognlStack.setValue(cellDefinition.getDataName(), value);
        }catch(ExcelManipulateException e){
          if(readStatus.getStatus() == ReadStatus.STATUS_SUCCESS)
            readStatus.setStatus(ReadStatus.STATUS_DATA_COLLECTION_ERROR);
          readStatus.addException(e);
        }     
View Full Code Here

        logger.debug("{} styles found", styleMap.keySet().size());
      }       
      for(int i=0; i< definition.getExcelSheets().size(); i++){
        writeSheet(wb.getSheetAt(i),
            definition.getExcelSheets().get(i),
            new OgnlStack(beans), styleMap, writeStatus);
      }
      reCalculateWorkbook(wb);
      wb.setActiveSheet(0);
      try {
        wb.write(os);
View Full Code Here

      for(int i=0; i< beansList.size(); i++){
        Sheet newSheet = wb.createSheet("Auto Generated Sheet " + i);
        ExcelUtil.copySheet(wb.getSheetAt(0), newSheet);
      writeSheet(newSheet,
            definition.getExcelSheets().iterator().next(),
            new OgnlStack(beansList.get(i)), styleMap, writeStatus);
      }
      //remove template sheet
      wb.removeSheetAt(0);
      reCalculateWorkbook(wb);
      wb.setActiveSheet(0);
View Full Code Here

TOP

Related Classes of loxia.utils.OgnlStack

Copyright © 2018 www.massapicom. 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.