package com.javahonk;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.javahonk.di.bean.Person;

public class SpringAutowireAnnotation {

    public static void main(String[] args) throws Exception {

	ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
		"spring/springResourceContext.xml");
	applicationContext.getBean("person");
	Person person = applicationContext.getBean("person",
		Person.class);

	// We are getting person object using @Autowired functionality
	System.out.println("Steet: "
		+ person.getAddress().getSteetName() + " City: "
		+ person.getAddress().getCity() + " State: "
		+ person.getAddress().getState() + " Zip: "
		+ person.getAddress().getZip());

    }

}