can verify if the injector has a direct mapping (not inherited from parent)

After introducing the `parentInjector`, there was no way to tell if the mapping comes from the injector or from one of its parents, therefore added the `hasDirectMapping` method.

(this is the cleaned up version of the previous pull request, used `git rebase` instead of `git merge` to integrate the upstream changes)