Skip to content

Commit

Permalink
optimize codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ozlerhakan committed Nov 29, 2018
1 parent 8651cd8 commit 853ab5a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/com/poiji/bind/mapping/WorkBookContentHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,35 @@ List<WorkBookSheet> getSheets() {

@Override
public void setDocumentLocator(Locator locator) {
//empty method
//no-op
}

@Override
public void startDocument() {
//no-op
}

@Override
public void endDocument() {
//no-op
}

@Override
public void startPrefixMapping(String prefix, String uri) {
//no-op
}

@Override
public void endPrefixMapping(String prefix) {
//no-op
}

@Override
public void startElement(String uri, String localName, String qName, Attributes atts) {

//there are multipel elements to an excel xml layout
//we only care about the sheet infor
if (qName.equals("sheet")) {
if ("sheet".equals(qName)) {
individualSheet = new WorkBookSheet();

//loop throught all the attributes and add to the new sheet
Expand Down Expand Up @@ -82,7 +86,7 @@ public void endElement(String uri, String localName, String qName) {

//onces finished reading the element, if end of sheet, add to array of work books sheets so can loop them later
//set this sheet to null as its not needed any more
if (qName.equals("sheet")) {
if ("sheet".equals(qName)) {
sheets.add(individualSheet);
individualSheet = null;
}
Expand Down

0 comments on commit 853ab5a

Please sign in to comment.