GithubHelp home page GithubHelp logo

neeballearningpvtltd / excel-to-pojo Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 31 KB

This utility is used for parsing excel sheets data into java object used for Inventory Management System

License: MIT License

Java 85.14% JavaScript 14.86%
apache-poi pojo excelreader apache poi mapper converter java excel

excel-to-pojo's Introduction

Excel to POJO

Description

This is utility used for parsing excel sheets data into java object used for Inventory Management System here

Dependencies

Jackson for json format to java format maven link .

Apache Poi for .xlsx ( 2007 and above excel formats ) maven link and for .xls support you need to add maven link .

Note

It can used for both .xls and .xslx file format together using this .

Usage

    • Call parseFile method of FileParser which takes excel File and json format file of how the data will be mapped in POJO
      File excelFile =new File('Absolute PATH of excel file');
    
      File JSONFormatFile =new File('Absolute PATH of JSON format file');
    
      FileParser<Inventory> fileParser = new FileParser<>(excelFile , JSONFormatFile ) ;
    
      Map<Class < ? extends Inventory > ,List<Inventory >> map = fileParser.parseFile();
    • It returns Map< Class<? extends T> , list<? extends T> > of POJO's

      • Key for the Map is the Class of the POJO .
      • Value is List of all the POJO's that are read from row of corresponding sheets

      Note

      T in my case is Inventory class which is common abstract class for all my POJO's .

  • Make sure that name of SheetFormat's name and POJO Class Name , the ColumnFormat's name and POJO's Fields name matches exactly , else SheetParsingException and RowParsingException is raised respectively .

  • Excel Sheets can be read from any index ( 0 based ) just provide index of the Sheet in JSONFormatFile like this

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.