package com.springconfig.example.chapter3;
![]()
@Configuration
public class ConfigurationWithSupport extends ConfigurationSupport...{
@Bean
public String sayWord()...{
String word = (String)getBean("word");
return word;
}
}
public static void main(String[] args)...{
ApplicationContext context = new AnnotationApplicationContext(ConfigurationFull.class.getName(),ConfigurationWithSupport.class.getName());
String word = (String)context.getBean("sayWord");
System.out.println(word);
}
@Bean
public HelloWorld helloWorld()...{
HelloWorld helloWorld = new HelloWorld();
helloWorld.setWord(word());
return helloWorld;
}