rendered paste body<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<context:annotation-config/>
<bean id="quest" class="knight.HolyGrailQuest"/>
<bean id="name" class="java.lang.String" >
<constructor-arg value="Lancelot"></constructor-arg>
</bean>
<bean id="knight" class="knight.KnightOfTheRoundTable" >
</bean>
</beans>
public class KnightOfTheRoundTable implements Knight{
private String name;
private Quest quest;
public KnightOfTheRoundTable(){}
@Autowired
public KnightOfTheRoundTable(String name, Quest q) {
this.name = name;
this.quest = q;
}
public void setQuest(Quest q){
quest = q;
}
@Override
public Object embarkOnQuest() throws QuestFailedException {
return name +" received "+quest.embark().toString()+" like a boss";
}
@Override
public String getName() {
return name;
}
}