elaatifi/orika — pull request #2 by papegaaij (2012-11-13 19:08:08+00:00)
Title: Allow custom implementation of MapperFacade

DefaultMapperFactory always creates a MapperFacadeImpl. It is possible to wrap this MapperFacade in a subclass by overriding getMapperFacade, but many method calls to MapperFacade are made from inside MapperFacadeImpl, making it impossible to intercept these method calls. With a custom MapperFacade (for example a subclass of MapperFacadeImpl), it is possible to intercept all calls, for example to wrap MappingStrategies.

This pull request contains a small patch to DefaultMapperFactory which makes it possible to build a custom MapperFacade. A minor issue is that the method is called from the constructor, when the instance variables of the factory are not yet initialized. IMHO it should be better to build these components in the builder, together with other components of the factory, but that would be a much bigger patch.