本文整理匯總了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();
}
示例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
);
}
示例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);
}
示例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);
}
示例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>() {
};
}
示例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>() {
};
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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));
}
示例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();
}