Java 类javax.inject.Named 实例源码

项目:CleanArchitechture    文件:BaseFragmentModule.java   
@Provides
@Named(CHILD_FRAGMENT_MANAGER)
@PerFragment
static FragmentManager childFragmentManager(@Named(FRAGMENT) Fragment fragment) {
    return fragment.getChildFragmentManager();
}
项目:verify-hub    文件:SamlEngineModule.java   
@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
    );
}
项目:ProjectAres    文件:InjectableMethodTest.java   
@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);
}
项目:verify-hub    文件:SamlEngineModule.java   
@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);
}
项目:OperatieBRP    文件:BevragingVerzoekVerwerkerProvider.java   
/**
 * {@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>() {
    };
}
项目:OperatieBRP    文件:BevragingVerzoekVerwerkerProvider.java   
/**
 * {@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>() {
    };
}
项目:mapr-music    文件:RateService.java   
@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;
}
项目:OperatieBRP    文件:ConversieAangifteAdreshoudingController.java   
/**
 * 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));
}
项目:github-users    文件:DrawerPresenter.java   
@Inject
public DrawerPresenter(
    @Named("projectGitHubUrl") String projectUrl,
    Sink<SnackbarMessageEvent> snackbarMessageSink,
    UrlOpener urlOpener) {

  this.projectUrl = projectUrl;
  this.snackbarMessageSink = snackbarMessageSink;
  this.urlOpener = urlOpener;
}
项目:bcg    文件:ClientModule.java   
@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;
}
项目:Dagger2-Retrofit-MVP-OKHttp3-ButterKnife-Glide-Example    文件:ApplicationModule.java   
@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();
}
项目:fast-list    文件:AppModule.java   
@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();
}
项目:ProjectAres    文件:MapLoaderImpl.java   
@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;
}
项目:OperatieBRP    文件:RedenVerkrijgingNLNationaliteitController.java   
/**
 * 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));
}
项目:Lagerta    文件:SubscriberConsumer.java   
@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();
}
项目:android-training-2017    文件:UserEndpoint.java   
/**
 * Updates an existing {@code User}.
 *
 * @param id   the ID of the entity to be updated
 * @param user the desired state of the entity
 * @return the updated version of the entity
 * @throws NotFoundException if the {@code id} does not correspond to an existing
 *                           {@code User}
 */
@ApiMethod(
        name = "update",
        path = "user/{id}",
        httpMethod = ApiMethod.HttpMethod.PUT)
public User update(@Named("id") Long id, User user) throws NotFoundException {
    // TODO: You should validate your ID parameter against your resource's ID here.
    checkExists(id);
    ofy().save().entity(user).now();
    logger.info("Updated User: " + user);
    return ofy().load().entity(user).now();
}
项目:Aurora    文件:ClientModule.java   
/**
 * 提供 {@link RxCache}
 *
 * @param cacheDirectory RxCache缓存路径
 * @return
 */
@Singleton
@Provides
RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
    RxCache.Builder builder = new RxCache.Builder();
    RxCache rxCache = null;
    if (configuration != null) {
        rxCache = configuration.configRxCache(application, builder);
    }
    if (rxCache != null) return rxCache;
    return builder
            .persistence(cacheDirectory, new GsonSpeaker());
}
项目:OperatieBRP    文件:SoortVrijBerichtController.java   
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected SoortVrijBerichtController(@Named("soortVrijBerichtRepository") final ReadWriteRepository<SoortVrijBericht, Short> repository) {
    super(repository,
            Collections.singletonList(new Filter<>(NAAM, new StringValueAdapter(), new LikePredicateBuilderFactory(NAAM))),
            Collections.emptyList(),
            Collections.singletonList(NAAM));
}
项目:fpm    文件:CoastlineGenerator.java   
@Inject
public CoastlineGenerator(@Named("com.mappy.fpm.coastline.tomtomFolder") String tomtomFolder, //
                          @Named("com.mappy.fpm.coastline.workspace") String workspace, //
                          OsmosisSerializer serializer) {
    this.tomtomFolder = tomtomFolder;
    this.workspace = workspace;
    this.serializer = serializer;
}
项目:AndroidSensors    文件:RawGPSMeasurementsGatherer.java   
@Inject
public RawGPSMeasurementsGatherer(SensorConfig sensorConfig,
                                  LocationManager locationManager,
                                  @Named("gpsSensorEnableRequester") SensorEnableRequester sensorEnableRequester,
                                  @Named("fineLocationPermissionChecker") PermissionChecker permissionChecker,
                                  @Named("rawGPSSensorChecker") SensorChecker sensorChecker,
                                  SensorRequirementChecker sensorRequirementChecker) {

    super(sensorConfig, locationManager,
            sensorEnableRequester, permissionChecker, sensorChecker, sensorRequirementChecker);
}
项目:Aurora    文件:ClientModule.java   
/**
 * 需要单独给 {@link RxCache} 提供缓存路径
 *
 * @param cacheDir
 * @return
 */
@Singleton
@Provides
@Named("RxCacheDirectory")
File provideRxCacheDirectory(File cacheDir) {
    File cacheDirectory = new File(cacheDir, "RxCache");
    return DataHelper.makeDirs(cacheDirectory);
}
项目:verify-matching-service-adapter    文件:MetadataCertificateValidator.java   
@Inject
public MetadataCertificateValidator(
        MetadataResolver metadataResolver,
        MetadataCertificatesRepository metadataCertificatesRepository,
        @Named("HubEntityId") String hubEntityId,
        @Named("HubFederationId") String hubFederationId) {
    this.metadataResolver = metadataResolver;
    this.metadataCertificatesRepository = metadataCertificatesRepository;
    this.hubEntityId = hubEntityId;
    this.hubFederationId = hubFederationId;
}
项目:MVVMArms    文件:ClientModule.java   
/**
 * 提供 {@link RxCache}
 *
 * @param cacheDirectory RxCache 缓存路径
 * @return RxCache
 */
@Singleton
@Provides
RxCache provideRxCache(@Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
    RxCache.Builder builder = new RxCache.Builder();
    RxCache rxCache = null;
    if (configuration != null) {
        rxCache = configuration.configRxCache(mApplication, builder);
    }
    if (rxCache != null) {
        return rxCache;
    }
    return builder.persistence(cacheDirectory, new GsonSpeaker());
}
项目:verify-hub    文件:HubAsIdpMetadataHandler.java   
@Inject
public HubAsIdpMetadataHandler(
        MetadataResolver metadataResolver,
        SamlProxyConfiguration samlProxyConfiguration,
        @Named("HubEntityId") String hubEntityId,
        @Named("HubFederationId") String hubFederationId) {

    this.samlProxyConfiguration = samlProxyConfiguration;
    this.metadataResolver = metadataResolver;
    this.hubEntityId = hubEntityId;
    this.hubFederationId = hubFederationId;
}
项目:OperatieBRP    文件:ConversieRedenBeeindigenNationaliteitController.java   
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected ConversieRedenBeeindigenNationaliteitController(
    @Named("conversieRedenBeeindigenNationaliteitRepository") final ReadWriteRepository<RedenBeeindigingNationaliteit, Integer> repository) {
    super(repository,
            Arrays.asList(
                    new Filter<>(LO3_OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(LO3_OMSCHRIJVING)),
                    new Filter<>(REDEN_VERLIES_NATIONALITEIT, new StringValueAdapter(), new EqualPredicateBuilderFactory(REDEN_VERLIES_NATIONALITEIT)),
                    new Filter<>(REDEN_VERLIES_NATIONALITEIT_ID, new ShortValueAdapter(),
                            new EqualPredicateBuilderFactory(REDEN_VERLIES_NATIONALITEIT_ID))),
            null,
            Arrays.asList(LO3_OMSCHRIJVING, REDEN_VERLIES_NATIONALITEIT));
}
项目:OperatieBRP    文件:AanduidingInhoudingVermissingReisdocumentController.java   
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected AanduidingInhoudingVermissingReisdocumentController(
        @Named("aanduidingInhoudingVermissingReisdocumentRepository") final ReadWriteRepository<AanduidingInhoudingOfVermissingReisdocument, Short>
                repository) {
    super(repository, Collections.<Filter<?>>emptyList(), null, SORTERINGEN);
}
项目:AndroidBlueprints    文件:MessageViewModel.java   
@Inject
public MessageViewModel(MessageRepository messageRepository,
                        @Named("vm") CompositeDisposable compositeDisposable) {
    Timber.d("Init MessageViewModel");
    this.repository = messageRepository;
    this.compositeDisposable = compositeDisposable;
    this.messageIdentifier = new Identifier();
    this.subject = PublishSubject.create();
    this.messages = new MutableLiveData<>();
}
项目:Java-9-Programming-By-Example    文件:ColorManager.java   
@Inject
public ColorManager(@Named("nrColors") int nrColors, ColorFactory factory) {
    log.log(DEBUG,"creating colorManager for {0} colors",nrColors);
    this.nrColors = nrColors;
    this.factory = factory;
    createOrdering();
}
项目:vars-annotation    文件:WebPreferencesFactory.java   
@Inject
public WebPreferencesFactory(PreferencesService service, @Named("PREFS_TIMEOUT") Long timeoutMillis) {
    Preconditions.checkNotNull(service, "Missing a PreferencesService");
    Preconditions.checkNotNull(timeoutMillis, "Missing a timeout argument");
    Preconditions.checkArgument(timeoutMillis > 100, "The timeout was less than 100 ms. This isn't allowed.");
    this.systemRoot = new WebPreferences(service, timeoutMillis, null, "");
}
项目:Impala    文件:ApiModule.java   
@Provides
@Singleton
@Named("LOGIN_URL")
String provideLoginApiUrl() {
    return Constants.LOGIN_URL;
}
项目:clustercode    文件:ConfigurableCleanupStrategy.java   
@Inject
ConfigurableCleanupStrategy(Set<CleanupProcessor> cleanupProcessors,
                            @Named(CleanupModule.CLEANUP_STRATEGY_KEY) String strategies) {
    this.processors = ModuleHelper.sortImplementations(strategies, cleanupProcessors, CleanupProcessors::valueOf);
}
项目:GitHub    文件:ApiModule.java   
@Singleton
@Named("hotViralImages")
@Provides
Observable<List<Image>> provideHotViralImages(ImgurObservables imgurObservables) {
  return imgurObservables.getHotViralImages(5 /*maxPages*/);
}
项目:verify-hub    文件:MatchingServiceHealthcheckRequestGeneratorService.java   
@Inject
public MatchingServiceHealthcheckRequestGeneratorService(AttributeQueryGenerator<MatchingServiceHealthCheckRequest> attributeQueryGenerator,
                                                         @Named("HubEntityId") String hubEntityId) {
    this.attributeQueryGenerator = attributeQueryGenerator;
    this.hubEntityId = hubEntityId;
}
项目:clustercode    文件:ConfigurableMatcherStrategy.java   
@Inject
ConfigurableMatcherStrategy(@Named(ScanModule.PROFILE_STRATEGY_KEY) String strategies,
                            Set<ProfileMatcher> matchers) {
    this.matchers = ModuleHelper.sortImplementations(strategies, matchers, ProfileMatchers::valueOf);
}
项目:thirdcoast    文件:ClosedLoopMenuModule.java   
@Binds
@IntoSet
@Named("TALON_CONFIG_CL")
public abstract Command motionMagicCruiseVelocityCommand(
    MotionMagicCruiseVelocityCommand command);
项目:thirdcoast    文件:LimitMenuModule.java   
@Binds
@IntoSet
@Named("TALON_CONFIG_LIM")
public abstract Command enableForwardSoftLimitCommand(EnableForwardSoftLimitCommand command);
项目:thirdcoast    文件:MenuModule.java   
@Binds
@Singleton
@IntoSet
@Named("MAIN")
public abstract Command servoModeCommand(ServoModeCommand command);
项目:servicebuilder    文件:AppTokenClientFilter.java   
@Inject
public AppTokenClientFilter(@Named(APP_TOKEN_SUPPLIER_BIND_NAME) Supplier<String> appTokenSupplier) {
    this.appTokenSupplier = appTokenSupplier;
}
项目:fpm    文件:Geonames.java   
@Inject
public Geonames(@Named("com.mappy.fpm.geonames") String path) {
    alternateNames = alternateNames(path + "/alternateNames.txt");
    idByCountry = idByCountry(path + "/countryInfo.txt");
}
项目:OperatieBRP    文件:DBUnitBrpUtil.java   
/**
 * Constructor.
 * @param dataSource datasource
 */
@Inject
public DBUnitBrpUtil(@Named("syncDalDataSource") final DataSource dataSource) throws DataSetException {
    this.dataSource = dataSource;
    initTabellen();
}