I've implemented the initial modifications and the pull request is here https://github.com/apache/sling-org-apache-sling-api/pull/8
Right now, I've centralized the custom converters. At some point I may implement a Converter service which would allow you to request a Converter that has been per-configured. I'm imagining something along the lines of how the adaptTo functionality has a view in the System console that provides insight into all the possible adaptions. It would be useful to show an end user all of the possible conversions they could use. Course that might not be practical. - Jason On Mon, Nov 19, 2018, at 6:58 AM, David Bosschaert wrote: > Hi all, > > On Mon, 19 Nov 2018 at 07:22, Carsten Ziegeler <[email protected]> wrote: > > > In addition to what has already been said, the converter might differ in > > three ways: > > > > a) additional rules > > If the converter supports more conversions than what we have today, > > that's not an issue > > b) missing rules > > If the converter does not support a conversion that we have today, we > > can simply add the missing rule > > c) different rule > > If the converter converts the same object into a target class > > differently from what we do today, than this might be an issue. However, > > I guess this can only happen for things like date conversion. In these > > case we can simply add our own rule on top of the converter > > > > > Yes, the OSGi Converter supports custom rules which allow tweaking its > behaviour, it's documented here: > https://osgi.org/specification/osgi.cmpn/7.0.0/util.converter.html#util.converter-customizing.converters > > Best regards, > > David
