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

org.sfm.reflect.impl.InjectConstructorInstantiator Maven / Gradle / Ivy

package org.sfm.reflect.impl;

import java.util.Map;

import org.sfm.reflect.Getter;
import org.sfm.reflect.Instantiator;
import org.sfm.reflect.asm.ConstructorDefinition;
import org.sfm.reflect.asm.ConstructorParameter;

public final class InjectConstructorInstantiator implements Instantiator {
	
	

	private final ConstructorDefinition constructorDefinition;
	private final ArgumentBuilder argBuilder;

	public InjectConstructorInstantiator(ConstructorDefinition constructorDefinition, Map> injections) {
		this.constructorDefinition = constructorDefinition;
		this.argBuilder = new ArgumentBuilder(constructorDefinition, injections);
	}

	@Override
	public T newInstance(S s) throws Exception {
		return constructorDefinition.getConstructor().newInstance(argBuilder.build(s));
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy