Giter Site home page Giter Site logo

excel-and-text-file-parsing-with-annotation-java's Introduction

Excel And Text File Parsing With Annotation-

Hello. This framework works with Excel and text file format. you do with Annotationn a correct model and use ExcelManagerFactory to seriliaze and deserilize file.

  public class MessageExcel{
     @sheet(name="test")
     private Header heaer;
     @Sheet(name = "test1")
     private List<Body> message;

public MessageExcel() {
    this.header = new Header();
    this.message = new ArrayList<Body>();
}

public Header getHeader() {
    return header;
}

public void setHeader(Header header) {
    this.header = header;
}

public List<Body> getMessage() {
    return message;
}

public void setMessage(List<Body> message) {
    this.message = message;
}}

And

@DescriptionColumn(description = "test3")
@NotNullValidation()
@ColorCell(blue = 100, green = 10, red = 250)
private String accNum;

@NotNullValidation()
@DescriptionColumn(description = "test4")
@ConvertTo(convertTo = TypeObject.INT)
@ColorCell(blue = 200, green = 150, red = 80)
private int totalCount;

@NotNullValidation()
@DescriptionColumn(description = "test5")
@ColorCell(blue = 200, green = 150, red = 80)
@ConvertTo(convertTo = TypeObject.Long)

private double totalSuml;

/

public HeaderString() {
}

public String getAccNum() {
    return accNum;
}

public void setAccNum(String accNum) {
    this.accNum = accNum;
}

public int getTotalCount() {
    return totalCount;
}

public void setTotalCount(int totalCount) {
    this.totalCount = totalCount;
}

public Double getTotalSuml() {
    return totalSuml;
}

public void setTotalSuml(Double totalSuml) {
    this.totalSuml = totalSuml;
}

after your entity ready you must write this code:

ParserManager excelManager = ExcelManagerFactory.getExcelParserManager("d:\\Book1.xlsx",MessageExcel.class);
ResultModel message = excelManager.deSerialize();
System.out.println(message.getResultModel().toString());

ParserManager excelManagerSerialize = ExcelManagerFactory.getExcelParserManager("d:\\Book2.xlsx", MessageExcel.class);
excelManagerSerialize.serialize(message.getResultModel());

excel-and-text-file-parsing-with-annotation-java's People

Contributors

lotfiali avatar

Stargazers

Omid Pourhadi avatar iacdp avatar Moji avatar  avatar  avatar

Watchers

 avatar  avatar

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.