28 lines
836 B
Java
28 lines
836 B
Java
|
package eu.eudat.logic.utilities.documents.xml.dmpXml;
|
||
|
|
||
|
import eu.eudat.logic.utilities.documents.xml.dmpXml.dmpProfileModel.DmpProfile;
|
||
|
|
||
|
import javax.xml.bind.JAXBContext;
|
||
|
import javax.xml.bind.JAXBException;
|
||
|
import javax.xml.bind.Unmarshaller;
|
||
|
import java.io.File;
|
||
|
import java.io.IOException;
|
||
|
|
||
|
public class ImportXmlBuilderDmpProfile {
|
||
|
|
||
|
public DmpProfile build(File xmlFile) throws IOException {
|
||
|
DmpProfile dmpProfile = new DmpProfile();
|
||
|
JAXBContext jaxbContext = null;
|
||
|
try {
|
||
|
jaxbContext = JAXBContext.newInstance(DmpProfile.class);
|
||
|
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
|
||
|
dmpProfile = (DmpProfile) unmarshaller.unmarshal(xmlFile);
|
||
|
} catch (JAXBException e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
|
||
|
return dmpProfile;
|
||
|
}
|
||
|
|
||
|
}
|