當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。