Usually you need a setter for the Mapper inside Outer and an instance of the required Mapper . But since this:
which becomes a bit complicated (as you defined). If you make them public, I'm sure you can use the instance with Outer$MapperA , etc. But that seems a bit unpleasant. So:
- should they be internal and private?
- perhaps Outer can take the string and determine whether to create instances of
MapperA or MapperB . that is, there is a factory function here.
The simplest task is to really determine if they should be internal / private. If this is so, then in fact they should not be mentioned in the config, which should talk about public classes.
source share