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

com.github.ruediste.salta.standard.DefaultJITBindingKeyRule Maven / Gradle / Ivy

Go to download

Core of the Salta Framework. Provides most of the infrastructure, but no API

There is a newer version: 1.1
Show newest version
package com.github.ruediste.salta.standard;

import java.lang.annotation.Annotation;

import com.github.ruediste.salta.core.CoreDependencyKey;
import com.github.ruediste.salta.core.JITBindingKey;
import com.github.ruediste.salta.core.JITBindingKeyRule;
import com.github.ruediste.salta.core.attachedProperties.AttachedProperty;
import com.github.ruediste.salta.standard.config.StandardInjectorConfiguration;
import com.google.common.reflect.TypeToken;

public final class DefaultJITBindingKeyRule implements JITBindingKeyRule {

	private StandardInjectorConfiguration config;
	public static final AttachedProperty jitBindingKeyRequiredQualifiers = new AttachedProperty<>(
			"required qualifiers");
	public static final AttachedProperty> jitBindingKeyType = new AttachedProperty<>(
			"type");

	public DefaultJITBindingKeyRule(StandardInjectorConfiguration config) {
		this.config = config;
	}

	@Override
	public void apply(CoreDependencyKey dependency, JITBindingKey key) {
		DefaultJITBindingKeyRule.jitBindingKeyType.set(key, dependency.getType());
		DefaultJITBindingKeyRule.jitBindingKeyRequiredQualifiers.set(key, config.getRequiredQualifier(dependency));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy