Replace custom converters with DefaultFormattingConversionService#5186
Open
scordio wants to merge 1 commit intospring-projects:mainfrom
Open
Replace custom converters with DefaultFormattingConversionService#5186scordio wants to merge 1 commit intospring-projects:mainfrom
DefaultFormattingConversionService#5186scordio wants to merge 1 commit intospring-projects:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b8a8484 to
4aa4807
Compare
4aa4807 to
4725c88
Compare
Contributor
|
Thank you for the PR! It's always better to leverage what we can from Spring Framework indeed. I will plan this for 6.1. I am just not sure yet if we really need the |
Contributor
Author
I created that because the FormattingConversionService conversionService = new DefaultFormattingConversionService();
conversionService.addFormatterForFieldType(Date.class, new DateFormatter());
DateTimeFormatterRegistrar dateTimeFormatterRegistrar = new DateTimeFormatterRegistrar();
dateTimeFormatterRegistrar.setUseIsoFormat(true);
dateTimeFormatterRegistrar.registerFormatters(conversionService);But I'm totally fine to inline it in those places or go in a different direction I haven't thought of, just let me know your preference 🙂 |
aefe948 to
1014c1b
Compare
Signed-off-by: Stefano Cordio <[email protected]>
1014c1b to
036ef58
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change replaces almost all existing custom converters with the Spring Framework's
DefaultFormattingConversionServicebuilt-in features. TheDateconverters have been replaced with a custom formatter because the existing Spring Batch logic is incompatible with what the framework can offer.DefaultFormattingConversionServicealso supportsZonedDateTimeandOffsetDateTimeout of the box; therefore, this PR also resolves #5178 and is an alternative to #5179.