// Path: src/main/java/com/jenkov/container/itf/factory/ILocalFactory.java
// public interface ILocalFactory {
// 
//      public Class getReturnType();
// 
//     /**
//      * This method is intended to be called *internally between* factories when creating
//      * an instance of some class. It is not intended to be called directly by client code,
//      * or from the Container. For that purpose use the instance(Object ... parameters)
//      * method. If you do call this method directly, a null will suffice for the localProducts
//      * array.
//      *
//      * NOTE: Only called on local factories. Never on global factories.
//      *
//      * <br/><br/>
//      * If you develop a custom IFactory implementation you should
//      * extend LocalFactoryBase and override this method, not the instance(Object ... parameters)
//      * method. If your factory implementation calls any other factories it should pass on
//      * both the parameters and localProducts object arrays!!
//      * ... as in factory.instance(parameters, localProducts); .
//      *  Do not just call the instance() or instance(parameters) method.
//      *
//      * @param parameters
//      * @param localProducts
//      * @return The created object.
//      */
//     public Object instance(Object[] parameters, Object[] localProducts);
// }
// 
// Path: src/main/java/com/jenkov/container/script/ParserException.java
// public class ParserException extends ContainerException {
// 
//     public ParserException(String errorContext, String errorCode, String errorMessage) {
//         super(errorContext, errorCode, errorMessage);
//     }
// 
//     public ParserException(String errorContext, String errorCode, String errorMessage, Throwable cause) {
//         super(errorContext, errorCode, errorMessage, cause);
//     }
// }


import com.jenkov.container.itf.factory.ILocalFactory;
import com.jenkov.container.script.ParserException;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
package com.jenkov.container.impl.factory;



/**
 * @author Jakob Jenkov - Copyright 2005 Jenkov Development
 */
public class FactoryBuilder {

    // ConstructorFactory methods
    public ILocalFactory createConstructorFactory(String className, List<ILocalFactory> constructorArgFactories, Class[] forcedArgumentTypes){

        Class theClass = FactoryUtil.getClassForName(className);
        if(theClass == null){
// Path: src/main/java/com/jenkov/container/itf/factory/ILocalFactory.java
// public interface ILocalFactory {
// 
//      public Class getReturnType();
// 
//     /**
//      * This method is intended to be called *internally between* factories when creating
//      * an instance of some class. It is not intended to be called directly by client code,
//      * or from the Container. For that purpose use the instance(Object ... parameters)
//      * method. If you do call this method directly, a null will suffice for the localProducts
//      * array.
//      *
//      * NOTE: Only called on local factories. Never on global factories.
//      *
//      * <br/><br/>
//      * If you develop a custom IFactory implementation you should
//      * extend LocalFactoryBase and override this method, not the instance(Object ... parameters)
//      * method. If your factory implementation calls any other factories it should pass on
//      * both the parameters and localProducts object arrays!!
//      * ... as in factory.instance(parameters, localProducts); .
//      *  Do not just call the instance() or instance(parameters) method.
//      *
//      * @param parameters
//      * @param localProducts
//      * @return The created object.
//      */
//     public Object instance(Object[] parameters, Object[] localProducts);
// }
// 
// Path: src/main/java/com/jenkov/container/script/ParserException.java
// public class ParserException extends ContainerException {
// 
//     public ParserException(String errorContext, String errorCode, String errorMessage) {
//         super(errorContext, errorCode, errorMessage);
//     }
// 
//     public ParserException(String errorContext, String errorCode, String errorMessage, Throwable cause) {
//         super(errorContext, errorCode, errorMessage, cause);
//     }
// }


// Path: src/main/java/com/jenkov/container/impl/factory/FactoryBuilder.java
import com.jenkov.container.itf.factory.ILocalFactory;
import com.jenkov.container.script.ParserException;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

package com.jenkov.container.impl.factory;



/**
 * @author Jakob Jenkov - Copyright 2005 Jenkov Development
 */
public class FactoryBuilder {

    // ConstructorFactory methods
    public ILocalFactory createConstructorFactory(String className, List<ILocalFactory> constructorArgFactories, Class[] forcedArgumentTypes){

        Class theClass = FactoryUtil.getClassForName(className);
        if(theClass == null){
            throw new ParserException(