com.github.ruediste.salta.standard.StandardStaticBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of salta-core Show documentation
Show all versions of salta-core Show documentation
Core of the Salta Framework. Provides most of the infrastructure, but no API
package com.github.ruediste.salta.standard;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Supplier;
import com.github.ruediste.salta.core.CoreDependencyKey;
import com.github.ruediste.salta.core.RecipeCreationContext;
import com.github.ruediste.salta.core.Scope;
import com.github.ruediste.salta.core.StaticBinding;
import com.github.ruediste.salta.core.compile.SupplierRecipe;
import com.github.ruediste.salta.matchers.Matcher;
import com.google.common.reflect.TypeToken;
/**
* Statically defined Binding.
*/
public class StandardStaticBinding extends StaticBinding {
public Matcher> dependencyMatcher;
public final Set> possibleTypes = new HashSet<>();
public CreationRecipeFactory recipeFactory;
public Supplier scopeSupplier;
@Override
public Set> getPossibleTypes() {
return possibleTypes;
}
@Override
public SupplierRecipe createRecipe(RecipeCreationContext ctx) {
return recipeFactory.createRecipe(ctx);
}
@Override
public String toString() {
return "StandardStaticBinding(" + dependencyMatcher + ")";
}
@Override
public Matcher> getMatcher() {
return dependencyMatcher;
}
@Override
protected Scope getScopeImpl() {
return scopeSupplier.get();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy