@SuppressWarnings("unchecked")
    public final <T> T get(Class<T> iface, String name) {
        if (namedInstances.containsKey(name)) {
            return (T) namedInstances.get(name);
        } else if (namedBindings.containsKey(name)) {
            Class<?> implementation = namedBindings.get(name);
            if (implementation != null) {
                T instance = (T) createInstance(implementation);
                namedInstances.put(name, instance);
                return instance;
            } else {
                return null;
            }
        } else {
            throw new IllegalArgumentException(iface.getName() + " " + name + " is not registered");
        }
    }
{@code AbstractModule} provides a base class for annotation based dependency injection

@author tiwe
querydsl-codegen/src/main/java/com/querydsl/codegen/AbstractModule.java