本文整理汇总了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();
}