File: context.xml
"http://www.springframework.org/dtd/spring-beans.dtd">
File: Main.java
import java.math.BigDecimal;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
public class Main {
public static void main(String[] args) throws Exception {
BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("context.xml"));
PropertyEditorTestBean testBean = (PropertyEditorTestBean) beanFactory.getBean("testBean");
System.out.println(testBean.getMyClass());
}
}
class PropertyEditorTestBean {
private Class myClass;
public Class getMyClass() {
return myClass;
}
public void setMyClass(Class myClass) {
this.myClass = myClass;
}
}