package jp.mydns.masahase.operateXML;

import java.io.InputStream;
import java.util.concurrent.Callable;

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

import jp.mydns.masahase.AbaqusResult.AbaqusResultType;

public class AbaqusResultUnMarshaller implements Callable<AbaqusResultType> {
	InputStream in;

	public AbaqusResultUnMarshaller(InputStream input) {
		in = input;
	}

	@SuppressWarnings("unchecked")
	public AbaqusResultType call() throws Exception {
		JAXBContext jaxbcont = JAXBContext
				.newInstance("jp.mydns.masahase.AbaqusResult");
		Unmarshaller um = jaxbcont.createUnmarshaller();
		return (AbaqusResultType) ((JAXBElement<AbaqusResultType>) um
				.unmarshal(in)).getValue();
	}
}
