Bean
2021-11-14 (日) 12:01:50
Bean †
Beanの利用方法 †
Bean定義ファイル を使った利用 †
- Spring Bean Configuration File(Spring Bean 構成ファイル)
- XML
- org.springframework.context.support.ClassPathXmlApplicationContext;
<bean id="abc" class="com.abc"> <property name="def" value="DEF" /> </bean>
アノテーション を使った利用 †
- AnnotationConfigApplicationContext
- org.springframework.context.annotation.AnnotationConfigApplicationContext
- @Configuration
- org.springframework.context.annotation.Configuration;
- @Bean
- org.springframework.context.annotation.Bean;
Beanクラス †
- プロパティ
- privateフィールド
- Setterメソッド
- Getterメソッド