package com.ichir.projects.jaxb;

import java.io.InputStream;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import com.ichir.projects.beans.Person;

public class XmlLoader {

	private Person person;

	public void parse(InputStream is) throws JAXBException {
		JAXBContext context = JAXBContext.newInstance(Person.class);
		Unmarshaller unmarshaller = context.createUnmarshaller();
		person = (Person) unmarshaller.unmarshal(is);
	}
	
	public Person getPerson() {
		return person;
	}
}
