-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from mbrocchieri/parsing-error
Add option to not throw exception when parsing error and support defa…
- Loading branch information
Showing
10 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
fastexcel-reader/src/main/java/org/dhatim/fastexcel/reader/ReadingOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.dhatim.fastexcel.reader; | ||
|
||
public class ReadingOptions { | ||
public static final ReadingOptions DEFAULT_READING_OPTIONS = new ReadingOptions(false, false); | ||
private final boolean withCellFormat; | ||
private final boolean cellInErrorIfParseError; | ||
|
||
/** | ||
* @param withCellFormat If true, extract cell formatting | ||
* @param cellInErrorIfParseError If true, cell type is ERROR if it is not possible to parse cell value. | ||
* If false, an exception is throw when there is a parsing error | ||
*/ | ||
public ReadingOptions(boolean withCellFormat, boolean cellInErrorIfParseError) { | ||
this.withCellFormat = withCellFormat; | ||
this.cellInErrorIfParseError = cellInErrorIfParseError; | ||
} | ||
|
||
/** | ||
* @return true for extract cell formatting | ||
*/ | ||
public boolean isWithCellFormat() { | ||
return withCellFormat; | ||
} | ||
|
||
/** | ||
* @return true for cell type is ERROR if it is not possible to parse cell value, | ||
* false for an exception is throw when there is a parsing error | ||
*/ | ||
public boolean isCellInErrorIfParseError() { | ||
return cellInErrorIfParseError; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.