// 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);
// }


import com.jenkov.container.impl.factory.convert.*;
import com.jenkov.container.itf.factory.ILocalFactory;
import java.net.URL;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.math.BigInteger;
import java.math.BigDecimal;
        if("Short".equals(className))     return Short.class;
        if("char".equals(className))      return char.class;
        if("Character".equals(className)) return Character.class;
        if("int".equals(className))       return int.class;
        if("Integer".equals(className))   return Integer.class;
        if("long".equals(className))      return long.class;
        if("Long".equals(className))      return Long.class;
        if("float".equals(className))     return float.class;
        if("Float".equals(className))     return Float.class;
        if("double".equals(className))    return double.class;
        if("Double".equals(className))    return Double.class;
        if("BigInteger".equals(className))    return BigInteger.class;
        if("BigDecimal".equals(className))    return BigDecimal.class;
        if("URL".equals(className))       return URL.class;

        try {
            return Class.forName(className);
        } catch (ClassNotFoundException e) {
            return null;
        }

    }

    public static Class[] createEmptyClassArray(int size) {
        Class[] forcedArgumentTypes = new Class[size];
        for(int i=0; i<forcedArgumentTypes.length; i++) forcedArgumentTypes[i] = null;
        return forcedArgumentTypes;
    }

    //todo add ISO date formats 
// 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/impl/factory/FactoryUtil.java
import com.jenkov.container.impl.factory.convert.*;
import com.jenkov.container.itf.factory.ILocalFactory;
import java.net.URL;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.math.BigInteger;
import java.math.BigDecimal;

        if("Short".equals(className))     return Short.class;
        if("char".equals(className))      return char.class;
        if("Character".equals(className)) return Character.class;
        if("int".equals(className))       return int.class;
        if("Integer".equals(className))   return Integer.class;
        if("long".equals(className))      return long.class;
        if("Long".equals(className))      return Long.class;
        if("float".equals(className))     return float.class;
        if("Float".equals(className))     return Float.class;
        if("double".equals(className))    return double.class;
        if("Double".equals(className))    return Double.class;
        if("BigInteger".equals(className))    return BigInteger.class;
        if("BigDecimal".equals(className))    return BigDecimal.class;
        if("URL".equals(className))       return URL.class;

        try {
            return Class.forName(className);
        } catch (ClassNotFoundException e) {
            return null;
        }

    }

    public static Class[] createEmptyClassArray(int size) {
        Class[] forcedArgumentTypes = new Class[size];
        for(int i=0; i<forcedArgumentTypes.length; i++) forcedArgumentTypes[i] = null;
        return forcedArgumentTypes;
    }

    //todo add ISO date formats 
    public static ILocalFactory createConversionFactory(ILocalFactory sourceFactory, Class returnType){