6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

IntelliJ IDEA の Spring サポート - Autowired 補完

Last updated at Posted at 2016-01-19

IntelliJ 使っていたら、今まで使ってなかった便利な機能に気がついたのでメモ。

環境

  • Mac OS X Yosemite 10.10.3
  • IntelliJ IDEA 15.0.2
  • Spring Boot 1.3.1.RELEASE

操作

オートワイアリング可能なコード上で、Command + N を入力する。
[Generate] メニューが表示されるので、@Autowired Dependency.. を選択する。
スクリーンショット 2016-01-19 19.41.24.png

すると、このようにオートワイアリング可能なオブジェクトの一覧が表示されるのである。
スクリーンショット 2016-01-19 19.42.28.png

オブジェクトを選択して [OK] すると、フィールドインジェクションにより、オートワイアリングをおこなうコードが自動生成される。

これでいろんなファイルを行ったりきたりしなくても、依存解決ができる!

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?