@SuppressWarnings({"unchecked"})
    public Map<String, ?> buildObjects(Map<String, String> kvPairs) {

        if (kvPairs != null && !kvPairs.isEmpty()) {

            BeanConfigurationProcessor processor = new BeanConfigurationProcessor();

            for (Map.Entry<String, String> entry : kvPairs.entrySet()) {
                String lhs = entry.getKey();
                String rhs = interpolator.interpolate(entry.getValue());

                String beanId = parseBeanId(lhs);
                //a beanId could be parsed, so the line is a bean instance definition
                if (beanId != null) {
                    processor.add(new InstantiationStatement(beanId, rhs));
                    //the line must be a property configuration
                } else {
                    processor.add(new AssignmentStatement(lhs, rhs));
                }
            }

            processor.execute();

            //SHIRO-778: onInit method on AuthenticatingRealm is called twice
            objects.keySet().stream()
                    .filter(key -> !kvPairs.containsKey(key))
                    .forEach(key -> LifecycleUtils.init(objects.get(key)));
        } else {
            //SHIRO-413: init method must be called for constructed objects that are Initializable
            LifecycleUtils.init(objects.values());
        }

        return objects;
    }
Plug in another way to get objects into configuration, ex: CDI

@param alternateObjectSupplier not null (empty lambda ok)
@since 2.0
config/ogdl/src/main/java/org/apache/shiro/config/ogdl/ReflectionBuilder.java