本文整理了Java中javax.inject.Inject
类的一些代码示例,展示了Inject
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Inject
类的具体详情如下:
包路径:javax.inject.Inject
类名称:Inject
暂无
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public ClusterEventBusProvider(@Named("async_eventbus_processors") final int asyncEventbusProcessors,
final MetricRegistry metricRegistry) {
this.asyncEventbusProcessors = asyncEventbusProcessors;
this.metricRegistry = metricRegistry;
}
代码示例来源:origin: android10/Android-CleanArchitecture
@Inject
GetUserList(UserRepository userRepository, ThreadExecutor threadExecutor,
PostExecutionThread postExecutionThread) {
super(threadExecutor, postExecutionThread);
this.userRepository = userRepository;
}
代码示例来源:origin: square/dagger
@Singleton
public static class L {
@Inject @Named("one") F f;
@Inject Provider<L> lProvider;
}
代码示例来源:origin: javaee/glassfish
@Service
public final class Transactions implements PostConstruct, PreDestroy {
@Inject @Named("transactions-executor") @Optional
private ExecutorService executor;
代码示例来源:origin: android10/Android-CleanArchitecture
@Inject
GetUserDetails(UserRepository userRepository, ThreadExecutor threadExecutor,
PostExecutionThread postExecutionThread) {
super(threadExecutor, postExecutionThread);
this.userRepository = userRepository;
}
代码示例来源:origin: apache/maven
@Named
@Singleton
public class DefaultToolchainsBuilder
implements ToolchainsBuilder
@Inject
private ToolchainsReader toolchainsReader;
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public StreamCacheService(EventBus eventBus,
StreamService streamService,
@Named("daemonScheduler") ScheduledExecutorService executorService) {
this.eventBus = eventBus;
this.streamService = streamService;
this.executorService = executorService;
}
代码示例来源:origin: spring-projects/spring-framework
@Inject
private void inject(ITestBean testBean4, NestedTestBean[] nestedTestBeans, IndexedTestBean indexedTestBean) {
this.testBean4 = testBean4;
this.indexedTestBean = indexedTestBean;
this.nestedTestBeans = nestedTestBeans;
}
代码示例来源:origin: 58code/Argo
@Singleton
public class StatusCodeActionResult {
@Inject
@Named("HTTP_STATUS=404")
ActionResult sc404;
@Inject
@Named("HTTP_STATUS=405")
ActionResult sc405;
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public ProxiedRequestsExecutorService(@Named("proxied_requests_thread_pool_size") int proxiedRequestsMaxThreads) {
this.proxiedRequestsMaxThreads = proxiedRequestsMaxThreads;
}
代码示例来源:origin: spring-projects/spring-framework
@SuppressWarnings("serial")
public static class ObjectFactoryMapFieldInjectionBean implements Serializable {
@Inject
private Provider<Map<String, TestBean>> testBeanFactory;
public void setTestBeanFactory(Provider<Map<String, TestBean>> testBeanFactory) {
this.testBeanFactory = testBeanFactory;
}
public TestBean getTestBean() {
return this.testBeanFactory.get().values().iterator().next();
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public BCryptPasswordAlgorithm(@Named("user_password_bcrypt_salt_size") Integer saltSize) {
this.saltSize = saltSize;
}
代码示例来源:origin: spring-projects/spring-framework
public static class ProviderOfOptionalFieldInjectionBean {
@Inject
private Provider<Optional<TestBean>> testBean;
public Optional<TestBean> getTestBean() {
return this.testBean.get();
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public LdapConnector(@Named("ldap_connection_timeout") int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
代码示例来源:origin: spring-projects/spring-framework
@Inject
public ConstructorsCollectionResourceInjectionBean(ITestBean testBean4, List<NestedTestBean> nestedTestBeans) {
this.testBean4 = testBean4;
this.nestedTestBeans = nestedTestBeans;
}
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public SHA1HashPasswordAlgorithm(@Named("password_secret") String passwordSecret) {
this.passwordSecret = passwordSecret;
}
代码示例来源:origin: spring-projects/spring-framework
@Inject
private void inject(ITestBean testBean4, List<NestedTestBean> nestedTestBeans, IndexedTestBean indexedTestBean) {
this.testBean4 = testBean4;
this.indexedTestBean = indexedTestBean;
this.nestedTestBeans = nestedTestBeans;
}
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public ClusterDeflectorResource(@Context HttpHeaders httpHeaders,
NodeService nodeService,
RemoteInterfaceProvider remoteInterfaceProvider,
@Named("proxiedRequestsExecutorService") ExecutorService executorService) {
super(httpHeaders, nodeService, remoteInterfaceProvider, executorService);
}
代码示例来源:origin: spring-projects/spring-framework
public static class OptionalListFieldInjectionBean {
@Inject
private Optional<List<TestBean>> testBean;
public Optional<List<TestBean>> getTestBean() {
return this.testBean;
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Inject
public ClusterLoggersResource(NodeService nodeService,
RemoteInterfaceProvider remoteInterfaceProvider,
@Context HttpHeaders httpHeaders,
@Named("proxiedRequestsExecutorService") ExecutorService executorService) throws NodeNotFoundException {
super(httpHeaders, nodeService, remoteInterfaceProvider, executorService);
}
内容来源于网络,如有侵权,请联系作者删除!