All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cookingfox.chefling.impl.command.ValidateContainerCommandImpl Maven / Gradle / Ivy

Go to download

Chefling is a very minimal dependency injection container written in pure Java.

The newest version!
package com.cookingfox.chefling.impl.command;

import com.cookingfox.chefling.api.command.ValidateContainerCommand;
import com.cookingfox.chefling.impl.helper.CommandContainerVisitor;

/**
 * @see ValidateContainerCommand
 */
public class ValidateContainerCommandImpl extends AbstractCommand implements ValidateContainerCommand {

    public ValidateContainerCommandImpl(CommandContainer container) {
        super(container);
    }

    @Override
    public synchronized void validateContainer() {
        // recursively loop through all containers
        visitAll(_container, new CommandContainerVisitor() {
            @Override
            public void visit(CommandContainer container) {
                // resolve all mappings in container
                for (Class mapping : container.mappings.keySet()) {
                    container.getInstance(mapping);
                }
            }
        });
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy