net.sf.andromedaioc.bean.instantiation.FactoryMethodInstantiatorWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromeda-ioc Show documentation
Show all versions of andromeda-ioc Show documentation
Inversion of Control Framework for Android
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);
}
}