Package com.thoughtworks.excelparser.annotations

Examples of com.thoughtworks.excelparser.annotations.ExcelObject


  }

  public <T> List<T> createEntity(Sheet sheet, String sheetName, Class<T> clazz)
          throws ExcelParsingException {
    List<T> list = new ArrayList<T>();
    ExcelObject excelObject = getExcelObject(clazz);
    for (int currentLocation = excelObject.start(); currentLocation <= excelObject.end(); currentLocation++) {
      T object = getNewInstance(sheet, sheetName, clazz, excelObject.parseType(), currentLocation, excelObject.zeroIfNull());
      List<Field> mappedExcelFields = getMappedExcelObjects(clazz);
      for (Field mappedField : mappedExcelFields) {
        Class<?> fieldType = mappedField.getType();
        List<?> fieldValue = createEntity(sheet, sheetName, fieldType.equals(List.class) ? getFieldType(mappedField)
                : fieldType);
View Full Code Here


    }
    return fieldList;
  }

  private <T> ExcelObject getExcelObject(Class<T> clazz) throws ExcelParsingException {
    ExcelObject excelObject = clazz.getAnnotation(ExcelObject.class);
    if (excelObject == null) {
      throw new ExcelParsingException("Invalid class configuration - ExcelObject annotation missing - "
              + clazz.getSimpleName());
    }
    return excelObject;
View Full Code Here

TOP

Related Classes of com.thoughtworks.excelparser.annotations.ExcelObject

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.