-
Notifications
You must be signed in to change notification settings - Fork 344
Added validation functionality when reading files, generating error messages based on validation results. Supports manually adding error messages #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added ValidateReadListener to record validation error messages. - Introduced ValidateError and ValidateErrorHolder to store error messages. - Added FileErrorHandler and TextErrorHandler to handle error messages. - Updated ExcelReaderBuilder to include validation-related methods. - Added test cases to verify the validation feature.
@psxjoy This update adds the ability to validate whether a field is empty using the @ExcelProperty annotation. Future improvements may include length validation, duplicate checking, and more. Current Issues & Considerations: |
Added errorFile.deleteOnExit() after creating the error file directory. Ensured that the generated error files are deleted when the program exits
@psxjoy I checked the error message, and theoretically, the folder should be created when the FileUtils class is loaded. Could you help me check this? |
All test cases are expected to pass. In my opinion, there might be an issue in your logic causing the tests to fail. You might want to debug it locally to identify the problem. |
This is a major change, so I’ll take some time to think it through and also consider feedback from others during the code review. 这是个大的改动,我需要考虑一下并且参考其他的人code review建议。 |
Okay, my design may have many issues. Please let me know if you have any feasible suggestions. Thanks! |
…o feature/import-validate # Conflicts: # fastexcel-core/src/main/java/cn/idev/excel/annotation/ExcelProperty.java # fastexcel-core/src/main/java/cn/idev/excel/read/builder/ExcelReaderBuilder.java # fastexcel-core/src/main/java/cn/idev/excel/util/FileUtils.java
This change is indeed impactful. However, since no one else has reviewed it yet, I'll temporarily mark it as 这个改动的确很有作用。但是目前没人其他人code reveiw,我暂时把他标记为 develop completed。该PR 会在至少 +3(bonding)投票后合并到main年分支。感谢你的贡献! |
Thank you! If there's anything I can do, please let me know. |
Added validation functionality when reading files, generating error messages based on validation results. Supports manually adding error messages. Two methods for handling error messages were introduced:
Writing error messages back into the Excel file.
Concatenating error messages into a text format.