当前位置: 首页>>代码示例>>Java>>正文


Java Named类代码示例

本文整理汇总了Java中javax.inject.Named的典型用法代码示例。如果您正苦于以下问题:Java Named类的具体用法?Java Named怎么用?Java Named使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Named类属于javax.inject包,在下文中一共展示了Named类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: childFragmentManager

import javax.inject.Named; //导入依赖的package包/类
@Provides
@Named(CHILD_FRAGMENT_MANAGER)
@PerFragment
static FragmentManager childFragmentManager(@Named(FRAGMENT) Fragment fragment) {
    return fragment.getChildFragmentManager();
}
 
开发者ID:NamTranDev,项目名称:CleanArchitechture,代码行数:7,代码来源:BaseFragmentModule.java

示例2: getMatchingServiceRequestElementTransformer

import javax.inject.Named; //导入依赖的package包/类
@Provides
@SuppressWarnings("unused")
private Function<HubAttributeQueryRequest, Element> getMatchingServiceRequestElementTransformer(
        IdaKeyStore keyStore,
        EncryptionKeyStore encryptionKeyStore,
        EntityToEncryptForLocator entityToEncryptForLocator,
        SignatureAlgorithm signatureAlgorithm,
        DigestAlgorithm digestAlgorithm,
        @Named("HubEntityId") String hubEntityId
) {
    return hubTransformersFactory.getMatchingServiceRequestToElementTransformer(
            keyStore,
            encryptionKeyStore,
            entityToEncryptForLocator,
            signatureAlgorithm,
            digestAlgorithm,
            hubEntityId
    );
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:20,代码来源:SamlEngineModule.java

示例3: qualifiedDependency

import javax.inject.Named; //导入依赖的package包/类
@Test
public void qualifiedDependency() throws Exception {
    class Woot {
        String foo(@Named("q") int i) {
            return String.valueOf(i);
        }
    }

    InjectableMethod<?> method = InjectableMethod.forDeclaredMethod(new Woot(), "foo", int.class);
    String hi = Guice.createInjector(
        method.bindingModule(),
        binder -> binder.bind(int.class)
                        .annotatedWith(Names.named("q"))
                        .toInstance(123)
    ).getInstance(String.class);


    assertEquals("123", hi);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:20,代码来源:InjectableMethodTest.java

示例4: getResponseToInboundResponseFromIdpTransformer

import javax.inject.Named; //导入依赖的package包/类
@Provides
@Named("IdpSamlResponseTransformer")
private DecoratedSamlResponseToIdaResponseIssuedByIdpTransformer getResponseToInboundResponseFromIdpTransformer(
        ConcurrentMap<String, DateTime> assertionIdCache,
        SamlConfiguration samlConfiguration,
        @Named("authnResponseKeyStore") SigningKeyStore authnResponseKeyStore,
        IdaKeyStore keyStore,
        @Named("HubEntityId") String hubEntityId) {

    return hubTransformersFactory.getDecoratedSamlResponseToIdaResponseIssuedByIdpTransformer(
            authnResponseKeyStore, keyStore, samlConfiguration.getExpectedDestinationHost(),
            Urls.FrontendUrls.SAML2_SSO_RESPONSE_ENDPOINT, assertionIdCache,
            hubEntityId);
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:15,代码来源:SamlEngineModule.java

示例5: zoekPersoonOpAdresVerzoekVerwerker

import javax.inject.Named; //导入依赖的package包/类
/**
 * {@link BevragingVerzoekVerwerker} specifiek voor Zoek Persoon Op Adres.
 * @return de zoek persoon op adres verzoek verwerker
 */
@Bean
@Named("zoekPersoonOpAdres")
public BevragingVerzoekVerwerker<ZoekPersoonOpAdresVerzoek> zoekPersoonOpAdresVerzoekVerwerker() {
    return new GeneriekeBevragingVerzoekVerwerker<ZoekPersoonOpAdresVerzoek, BevragingResultaat>() {
    };
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:11,代码来源:BevragingVerzoekVerwerkerProvider.java

示例6: geefDetailsPersoonVerzoekVerwerker

import javax.inject.Named; //导入依赖的package包/类
/**
 * {@link BevragingVerzoekVerwerker} specifiek voor Geef Details Persoon.
 * @return de geef details persoon verzoek verwerker
 */
@Bean
@Named("geefDetailsPersoonVerwerker")
public BevragingVerzoekVerwerker<GeefDetailsPersoonVerzoek> geefDetailsPersoonVerzoekVerwerker() {
    return new GeneriekeBevragingVerzoekVerwerker<GeefDetailsPersoonVerzoek, BevragingResultaat>() {
    };
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:11,代码来源:BevragingVerzoekVerwerkerProvider.java

示例7: RateService

import javax.inject.Named; //导入依赖的package包/类
@Inject
public RateService(AlbumRateDao albumRateDao,
                   ArtistRateDao artistRateDao,
                   @Named("albumDao") AlbumDao albumDao,
                   @Named("artistDao") ArtistDao artistDao,
                   @Named("userDao") MaprDbDao<User> userDao) {

    this.albumRateDao = albumRateDao;
    this.artistRateDao = artistRateDao;
    this.albumDao = albumDao;
    this.artistDao = artistDao;
    this.userDao = userDao;
}
 
开发者ID:mapr-demos,项目名称:mapr-music,代码行数:14,代码来源:RateService.java

示例8: ConversieAangifteAdreshoudingController

import javax.inject.Named; //导入依赖的package包/类
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected ConversieAangifteAdreshoudingController(
    @Named("conversieAangifteAdreshoudingRepository") final ReadWriteRepository<AangifteAdreshouding, Integer> repository) {
    super(repository,
            Arrays.asList(
                    new Filter<>(LO3_OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(LO3_OMSCHRIJVING)),
                    new Filter<>(AANGEVER_ID, new ShortValueAdapter(), new EqualPredicateBuilderFactory(AANGEVER_ID)),
                    new Filter<>(REDENWIJZIGINGVERBLIJF_ID, new ShortValueAdapter(), new EqualPredicateBuilderFactory(REDENWIJZIGINGVERBLIJF_ID))),
            null,
            Arrays.asList(LO3_OMSCHRIJVING, AANGEVER, REDENWIJZIGINGVERBLIJF));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:16,代码来源:ConversieAangifteAdreshoudingController.java

示例9: DrawerPresenter

import javax.inject.Named; //导入依赖的package包/类
@Inject
public DrawerPresenter(
    @Named("projectGitHubUrl") String projectUrl,
    Sink<SnackbarMessageEvent> snackbarMessageSink,
    UrlOpener urlOpener) {

  this.projectUrl = projectUrl;
  this.snackbarMessageSink = snackbarMessageSink;
  this.urlOpener = urlOpener;
}
 
开发者ID:xemantic,项目名称:github-users,代码行数:11,代码来源:DrawerPresenter.java

示例10: provideCache

import javax.inject.Named; //导入依赖的package包/类
@Provides
@Singleton
public Cache provideCache(@Named("cacheDir") File cacheDir, @Named("cacheSize") long cacheSize) {
    Cache cache = null;

    try {
        cache = new Cache(new File(cacheDir.getPath(), HTTP_CACHE_PATH), cacheSize);
    } catch (Exception e) {
        e.printStackTrace();
    }

    return cache;
}
 
开发者ID:mirhoseini,项目名称:bcg,代码行数:14,代码来源:ClientModule.java

示例11: provideRetrofit

import javax.inject.Named; //导入依赖的package包/类
@Singleton
@Provides
Retrofit provideRetrofit(@Named("ok-1") OkHttpClient client, GsonConverterFactory converterFactory
        , RxJavaCallAdapterFactory adapterFactory) {
    return new Retrofit.Builder()
            .baseUrl(mBaseUrl)
            .addConverterFactory(converterFactory)
            .addCallAdapterFactory(adapterFactory)
            .client(client)
            .build();
}
 
开发者ID:metao1,项目名称:Dagger2-Retrofit-MVP-OKHttp3-ButterKnife-Glide-Example,代码行数:12,代码来源:ApplicationModule.java

示例12: provideFrescoOkHttpClient

import javax.inject.Named; //导入依赖的package包/类
@Singleton
@Provides
@Named("fresco_ok_http")
OkHttpClient provideFrescoOkHttpClient() {
  return new OkHttpClient.Builder()
      .readTimeout(30, TimeUnit.SECONDS)
      .writeTimeout(30, TimeUnit.SECONDS)
      .connectTimeout(30, TimeUnit.SECONDS)
      .followRedirects(true)
      .build();
}
 
开发者ID:tranngoclam,项目名称:fast-list,代码行数:12,代码来源:AppModule.java

示例13: MapLoaderImpl

import javax.inject.Named; //导入依赖的package包/类
@Inject MapLoaderImpl(Loggers loggers, @Named("serverRoot") Path serverRoot, MapConfiguration config, PGMMap.Factory mapFactory, MapErrorTracker mapErrorTracker) {
    this.mapErrorTracker = mapErrorTracker;
    this.logger = loggers.get(getClass());
    this.serverRoot = serverRoot;
    this.config = checkNotNull(config);
    this.mapFactory = mapFactory;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:MapLoaderImpl.java

示例14: RedenVerkrijgingNLNationaliteitController

import javax.inject.Named; //导入依赖的package包/类
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected RedenVerkrijgingNLNationaliteitController(
        @Named("redenVerkrijgingNLNationaliteitRepository") final ReadWriteRepository<RedenVerkrijgingNLNationaliteit, Short> repository) {
    super(repository,
            Arrays.asList(
                    new Filter<>(OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(OMSCHRIJVING)),
                    new Filter<>(CODE, new StringValueAdapter(), new EqualPredicateBuilderFactory(CODE))),
            Collections.emptyList(),
            Arrays.asList(CODE, OMSCHRIJVING));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:15,代码来源:RedenVerkrijgingNLNationaliteitController.java

示例15: SubscriberConsumer

import javax.inject.Named; //导入依赖的package包/类
@Inject
public SubscriberConsumer(
    LeadService lead,
    Serializer serializer,
    Committer committer,
    TransactionsBuffer buffer,
    DoneNotifier doneNotifier,
    FullCommitHandler fullCommitHandler,
    DeserializerClosure deserializerClosure,
    BufferOverflowCondition bufferOverflowCondition,
    KafkaFactory kafkaFactory,
    DataRecoveryConfig dataRecoveryConfig,
    @Named(DataCapturerBusConfiguration.NODE_ID) UUID consumerId,
    OnKafkaStop onKafkaStop
) {
    this.lead = lead;
    this.serializer = serializer;
    this.committer = committer;
    this.buffer = buffer;
    this.doneNotifier = doneNotifier.setBuffer(buffer);
    this.fullCommitHandler = fullCommitHandler.setBuffer(buffer);
    this.deserializerClosure = deserializerClosure.setBuffer(buffer);
    this.bufferOverflowCondition = bufferOverflowCondition;
    consumer = kafkaFactory.consumer(dataRecoveryConfig.getConsumerConfig(), onKafkaStop);

    this.consumerId = consumerId;
    remoteTopic = dataRecoveryConfig.getRemoteTopic();
    reconciliationTopic = dataRecoveryConfig.getReconciliationTopic();
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:30,代码来源:SubscriberConsumer.java


注:本文中的javax.inject.Named类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。