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

net.sf.andromedaioc.bean.instantiation.FactoryMethodInstantiatorWrapper Maven / Gradle / Ivy

The newest version!
package net.sf.andromedaioc.bean.instantiation;

import net.sf.andromedaioc.bean.param.ParameterWrapper;
import net.sf.andromedaioc.bean.wrapper.BeanWrapper;

import java.lang.reflect.Method;
import java.util.List;

/**
 * Instantiator wrapper for factory method instantiation process
 *
 * @author Alexey Mitrov
 */
public class FactoryMethodInstantiatorWrapper implements InstantiatorWrapper {

    private final BeanWrapper beanWrapper;
    private final Method method;

    public FactoryMethodInstantiatorWrapper(BeanWrapper beanWrapper, Method method) {
        this.beanWrapper = beanWrapper;
        this.method = method;
    }

    public Class[] getArgumentTypes() {
        return method.getParameterTypes();
    }

    public Instantiator getInstantiator(List arguments, InstanceProcessor instanceProcessor) {
        return new FactoryMethodInstantiator(beanWrapper, method, arguments, instanceProcessor);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy