com.google.inject.Binder

Here are the examples of the java api com.google.inject.Binder taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

558 Examples 7

19 Source : QuestStep.java
with BSD 2-Clause "Simplified" License
from Zoinkwiz

@Override
public void configure(Binder binder) {
}

19 Source : BaseEpbModule.java
with Apache License 2.0
from YANG-DB

protected void localPruner(Binder binder, Config conf) {
    binder.install(new PrivateModule() {

        @Override
        protected void configure() {
            this.bind(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(PlanTracer.PruneStrategy.Provider.planPruneStrategyParameter)).toInstance(localPrunerStrategy(conf));
            this.bindConstant().annotatedWith(named(PlanTracer.PruneStrategy.Provider.planPruneStrategyNameParameter)).to("Local:" + NoPruningPruneStrategy.clreplaced.getSimpleName());
            this.bind(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(BottomUpPlanSearcher.localPruneStrategyParameter)).toProvider(new TypeLiteral<PlanTracer.PruneStrategy.Provider<Plan, PlanDetailedCost>>() {
            });
            this.expose(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(BottomUpPlanSearcher.localPruneStrategyParameter));
        }
    });
}

19 Source : BaseEpbModule.java
with Apache License 2.0
from YANG-DB

protected void globalPruner(Binder binder, Config conf) {
    binder.install(new PrivateModule() {

        @Override
        protected void configure() {
            this.bind(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(PlanTracer.PruneStrategy.Provider.planPruneStrategyParameter)).toInstance(globalPrunerStrategy(conf));
            this.bindConstant().annotatedWith(named(PlanTracer.PruneStrategy.Provider.planPruneStrategyNameParameter)).to("Global:" + NoPruningPruneStrategy.clreplaced.getSimpleName());
            this.bind(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(BottomUpPlanSearcher.globalPruneStrategyParameter)).toProvider(new TypeLiteral<PlanTracer.PruneStrategy.Provider<Plan, PlanDetailedCost>>() {
            });
            this.expose(new TypeLiteral<PlanPruneStrategy<PlanWithCost<Plan, PlanDetailedCost>>>() {
            }).annotatedWith(named(BottomUpPlanSearcher.globalPruneStrategyParameter));
        }
    });
}

19 Source : SolidityGeneratorModule.java
with Eclipse Public License 1.0
from Yakindu

public void configure(GeneratorEntry entry, Binder binder) {
    binder.bind(IExecutionFlowGenerator.clreplaced).to(SolidityGenerator.clreplaced);
    binder.bind(ITypeSystem.clreplaced).to(SolidityTypeSystem.clreplaced);
    binder.bind(IQualifiedNameProvider.clreplaced).to(QualifiedNameProvider.clreplaced);
    binder.bind(ICodegenTypeSystemAccess.clreplaced).to(SolidityTypeSystemAccess.clreplaced);
}

19 Source : SolidityRuntimeModule.java
with Eclipse Public License 1.0
from Yakindu

@Override
public void configure(Binder binder) {
    super.configure(binder);
    binder.bind(String.clreplaced).annotatedWith(Names.named(DomainRegistry.DOMAIN_ID)).toInstance(DOMAIN_SOLIDITY);
    binder.bind(TypesFactory.clreplaced).toInstance(TypesFactory.eINSTANCE);
    binder.bind(SolidityFactory.clreplaced).toInstance(SolidityFactory.eINSTANCE);
    binder.bind(BuiltInDeclarations.clreplaced);
}

19 Source : SolidityRuntimeModule.java
with Eclipse Public License 1.0
from Yakindu

@Override
public void configureITypeSystem(Binder binder) {
    binder.bind(ITypeSystem.clreplaced).toInstance(getTypeSystem());
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
public void configureRuntimeLexer(com.google.inject.Binder binder) {
    binder.bind(org.eclipse.xtext.parser.antlr.Lexer.clreplaced).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(hu.bme.mit.inf.dslreasoner.parser.antlr.internal.InternalSmtLanguageLexer.clreplaced);
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment
public void configureIResourceDescriptions(com.google.inject.Binder binder) {
    binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.clreplaced).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.clreplaced);
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

@Override
public void configure(Binder binder) {
    properties = tryBindProperties(binder, "hu/bme/mit/inf/dslreasoner/SmtLanguage.properties");
    super.configure(binder);
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment
public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) {
    binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.clreplaced).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.clreplaced);
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureFileExtensions(Binder binder) {
    if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
        binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("smt2");
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureLanguageName(Binder binder) {
    binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("hu.bme.mit.inf.dslreasoner.SmtLanguage");
}

19 Source : AbstractSmtLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment
public void configureIScopeProviderDelegate(com.google.inject.Binder binder) {
    binder.bind(org.eclipse.xtext.scoping.IScopeProvider.clreplaced).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.clreplaced);
}

19 Source : AbstractAlloyLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
public void configureRuntimeLexer(com.google.inject.Binder binder) {
    binder.bind(org.eclipse.xtext.parser.antlr.Lexer.clreplaced).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(hu.bme.mit.inf.dslreasoner.parser.antlr.internal.InternalAlloyLanguageLexer.clreplaced);
}

19 Source : AbstractAlloyLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

@Override
public void configure(Binder binder) {
    properties = tryBindProperties(binder, "hu/bme/mit/inf/dslreasoner/AlloyLanguage.properties");
    super.configure(binder);
}

19 Source : AbstractAlloyLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureLanguageName(Binder binder) {
    binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("hu.bme.mit.inf.dslreasoner.AlloyLanguage");
}

19 Source : AbstractAlloyLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureFileExtensions(Binder binder) {
    if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
        binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("als");
}

19 Source : AbstractSolverLanguageUiModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.ui.labeling.LabelProviderFragment2
public void configureResourceUIServiceLabelProvider(Binder binder) {
    binder.bind(ILabelProvider.clreplaced).annotatedWith(ResourceServiceDescriptionLabelProvider.clreplaced).to(SolverLanguageDescriptionLabelProvider.clreplaced);
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureFileExtensions(Binder binder) {
    if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
        binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("vsc");
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureLanguageName(Binder binder) {
    binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.viatra.solver.language.SolverLanguage");
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

@Override
public void configure(Binder binder) {
    properties = tryBindProperties(binder, "org/eclipse/viatra/solver/language/SolverLanguage.properties");
    super.configure(binder);
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public void configureIResourceDescriptions(Binder binder) {
    binder.bind(IResourceDescriptions.clreplaced).to(ResourceSetBasedResourceDescriptions.clreplaced);
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.clreplaced).annotatedWith(Names.named(LexerBindings.RUNTIME)).to(InternalSolverLanguageLexer.clreplaced);
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public void configureIResourceDescriptionsPersisted(Binder binder) {
    binder.bind(IResourceDescriptions.clreplaced).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.clreplaced);
}

19 Source : AbstractSolverLanguageRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
public void configureIScopeProviderDelegate(Binder binder) {
    binder.bind(IScopeProvider.clreplaced).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.clreplaced);
}

19 Source : AbstractApplicationConfigurationUiModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.ui.labeling.LabelProviderFragment2
public void configureResourceUIServiceLabelProvider(Binder binder) {
    binder.bind(ILabelProvider.clreplaced).annotatedWith(ResourceServiceDescriptionLabelProvider.clreplaced).to(ApplicationConfigurationDescriptionLabelProvider.clreplaced);
}

19 Source : AbstractApplicationConfigurationRuntimeModule.java
with Eclipse Public License 1.0
from viatra

@Override
public void configure(Binder binder) {
    properties = tryBindProperties(binder, "hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.properties");
    super.configure(binder);
}

19 Source : AbstractApplicationConfigurationRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureLanguageName(Binder binder) {
    binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration");
}

19 Source : AbstractApplicationConfigurationRuntimeModule.java
with Eclipse Public License 1.0
from viatra

public void configureFileExtensions(Binder binder) {
    if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
        binder.bind(String.clreplaced).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("vsconfig");
}

19 Source : AbstractApplicationConfigurationRuntimeModule.java
with Eclipse Public License 1.0
from viatra

// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.clreplaced).annotatedWith(Names.named(LexerBindings.RUNTIME)).to(InternalApplicationConfigurationLexer.clreplaced);
}

19 Source : SuiteModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    binder.bind(SuiteFactory.clreplaced).in(SINGLETON);
    MapBinder<String, Suite> suites = newMapBinder(binder, String.clreplaced, Suite.clreplaced);
    Suites.findSuitesByPackageName(BASE_SUITES_PACKAGE).forEach(clazz -> suites.addBinding(nameForSuiteClreplaced(clazz)).to(clazz).in(SINGLETON));
    binder.install(additionalSuites);
}

19 Source : EnvironmentModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    binder.bind(PortBinder.clreplaced).in(SINGLETON);
    binder.bind(EnvironmentFactory.clreplaced).in(SINGLETON);
    binder.bind(EnvironmentConfigFactory.clreplaced).in(SINGLETON);
    binder.bind(EnvironmentOptions.clreplaced).toInstance(environmentOptions);
    binder.bind(Hadoop.clreplaced).in(SINGLETON);
    binder.bind(HadoopKerberos.clreplaced).in(SINGLETON);
    binder.bind(HadoopKerberosKms.clreplaced).in(SINGLETON);
    binder.bind(HydraIdenreplacedyProvider.clreplaced).in(SINGLETON);
    binder.bind(Kafka.clreplaced).in(SINGLETON);
    binder.bind(SeleniumChrome.clreplaced).in(SINGLETON);
    binder.bind(Standard.clreplaced).in(SINGLETON);
    binder.bind(StandardMultinode.clreplaced).in(SINGLETON);
    MapBinder<String, EnvironmentProvider> environments = newMapBinder(binder, String.clreplaced, EnvironmentProvider.clreplaced);
    Environments.findByBasePackage(ENVIRONMENT_PACKAGE).forEach(clazz -> environments.addBinding(Environments.nameForClreplaced(clazz)).to(clazz).in(SINGLETON));
    MapBinder<String, EnvironmentConfig> environmentConfigs = newMapBinder(binder, String.clreplaced, EnvironmentConfig.clreplaced);
    Environments.findConfigsByBasePackage(CONFIG_PACKAGE).forEach(clazz -> environmentConfigs.addBinding(nameForConfigClreplaced(clazz)).to(clazz).in(SINGLETON));
    binder.install(additionalEnvironments);
}

19 Source : PrestoVerifierModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    configBinder(binder).bindConfig(VerifierConfig.clreplaced);
    eventBinder(binder).bindEventClient(VerifierQueryEvent.clreplaced);
    Multibinder<String> supportedClients = newSetBinder(binder, String.clreplaced, SupportedEventClients.clreplaced);
    supportedClients.addBinding().toInstance("human-readable");
    supportedClients.addBinding().toInstance("file");
    Set<String> eventClientTypes = buildConfigObject(VerifierConfig.clreplaced).getEventClients();
    bindEventClientClreplacedes(eventClientTypes, newSetBinder(binder, EventClient.clreplaced));
}

19 Source : ThriftClientModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    binder.bind(ThriftHeaderProvider.clreplaced).to(DefaultThriftHeaderProvider.clreplaced).in(SINGLETON);
    driftClientBinder(binder).bindDriftClient(TrinoThriftService.clreplaced).withAddressSelector(extendedSimpleAddressSelector());
}

19 Source : ExtendedSimpleAddressSelectorBinder.java
with Apache License 2.0
from trinodb

@Override
public void bind(Binder binder, Annotation annotation, String prefix) {
    configBinder(binder).bindConfig(SimpleAddressSelectorConfig.clreplaced, annotation, prefix);
    binder.bind(AddressSelector.clreplaced).annotatedWith(annotation).toProvider(new ExtendedSimpleAddressSelectorProvider(annotation));
}

19 Source : RaptorSecurityModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    bindSecurityModule("none", new AllowAllAccessControlModule());
    bindSecurityModule("read-only", new ReadOnlySecurityModule());
    bindSecurityModule("file", new FileBasedAccessControlModule(catalogName));
}

19 Source : DatabaseMetadataModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder ignored) {
    install(installModuleIf(DatabaseConfig.clreplaced, config -> "mysql".equals(config.getDatabaseType()), binder -> {
        binder.install(new MySqlDataSourceModule());
        bindDaoSupplier(binder, ShardDao.clreplaced, MySqlShardDao.clreplaced);
    }));
    install(installModuleIf(DatabaseConfig.clreplaced, config -> "h2".equals(config.getDatabaseType()), binder -> {
        binder.install(new H2EmbeddedDataSourceModule("metadata", ForMetadata.clreplaced));
        bindDaoSupplier(binder, ShardDao.clreplaced, H2ShardDao.clreplaced);
    }));
}

19 Source : EncoderModule.java
with Apache License 2.0
from trinodb

public static MapBinder<String, RowEncoderFactory> encoderFactory(Binder binder) {
    return newMapBinder(binder, String.clreplaced, RowEncoderFactory.clreplaced);
}

19 Source : AvroEncoderModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    MapBinder<String, RowEncoderFactory> encoderFactoriesByName = encoderFactory(binder);
    encoderFactoriesByName.addBinding(AvroRowEncoder.NAME).to(AvroRowEncoderFactory.clreplaced).in(SINGLETON);
}

19 Source : IcebergMetastoreModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    binder.bind(MetastoreValidator.clreplaced).asEagerSingleton();
}

19 Source : HiveSecurityModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    bindSecurityModule("legacy", installModules(new LegacySecurityModule(), new StaticAccessControlMetadataModule()));
    bindSecurityModule("file", installModules(new FileBasedAccessControlModule(catalogName), new StaticAccessControlMetadataModule()));
    bindSecurityModule("read-only", installModules(new ReadOnlySecurityModule(), new StaticAccessControlMetadataModule()));
    bindSecurityModule("sql-standard", new SqlStandardSecurityModule());
    bindSecurityModule("allow-all", new AllowAllSecurityModule());
}

19 Source : ThriftMetastoreAuthenticationModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    install(getAuthenticationModule());
}

19 Source : RecordingHiveMetastoreModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    if (buildConfigObject(RecordingMetastoreConfig.clreplaced).getRecordingPath() != null) {
        install(new RecordingModule());
    } else {
        install(new NoRecordingModule());
    }
}

19 Source : CachingHiveMetastoreModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    configBinder(binder).bindConfig(CachingHiveMetastoreConfig.clreplaced);
    newOptionalBinder(binder, HiveMetastoreDecorator.clreplaced);
    newExporter(binder).export(HiveMetastore.clreplaced).as(generator -> generator.generatedNameOf(CachingHiveMetastore.clreplaced));
}

19 Source : HiveAuthenticationModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    bindAuthenticationModule(config -> noHdfsAuth(config) && !config.isHdfsImpersonationEnabled(), noHdfsAuthenticationModule());
    bindAuthenticationModule(config -> noHdfsAuth(config) && config.isHdfsImpersonationEnabled(), simpleImpersonatingHdfsAuthenticationModule());
    bindAuthenticationModule(config -> kerberosHdfsAuth(config) && !config.isHdfsImpersonationEnabled(), kerberosHdfsAuthenticationModule());
    bindAuthenticationModule(config -> kerberosHdfsAuth(config) && config.isHdfsImpersonationEnabled(), kerberosImpersonatingHdfsAuthenticationModule());
}

19 Source : JdbcModule.java
with Apache License 2.0
from trinodb

public static Multibinder<SessionPropertiesProvider> sessionPropertiesProviderBinder(Binder binder) {
    return newSetBinder(binder, SessionPropertiesProvider.clreplaced);
}

19 Source : JdbcModule.java
with Apache License 2.0
from trinodb

public static Multibinder<Procedure> procedureBinder(Binder binder) {
    return newSetBinder(binder, Procedure.clreplaced);
}

19 Source : JdbcModule.java
with Apache License 2.0
from trinodb

public static Multibinder<TablePropertiesProvider> tablePropertiesProviderBinder(Binder binder) {
    return newSetBinder(binder, TablePropertiesProvider.clreplaced);
}

19 Source : DecimalModule.java
with Apache License 2.0
from trinodb

@Override
public void configure(Binder binder) {
    configBinder(binder).bindConfig(DecimalConfig.clreplaced);
    bindSessionPropertiesProvider(binder, DecimalSessionSessionProperties.clreplaced);
}

19 Source : CredentialProviderModule.java
with Apache License 2.0
from trinodb

@Override
protected void setup(Binder binder) {
    bindCredentialProviderModule(INLINE, new InlineCredentialProviderModule());
    bindCredentialProviderModule(FILE, new ConfigFileBasedCredentialProviderModule());
    bindCredentialProviderModule(KEYSTORE, new KeyStoreBasedCredentialProviderModule());
    configBinder(binder).bindConfig(ExtraCredentialConfig.clreplaced);
    binder.bind(CredentialProvider.clreplaced).to(ExtraCredentialProvider.clreplaced).in(SINGLETON);
}

See More Examples