Skip to content

Instantly share code, notes, and snippets.

@yusufcakal
Created October 4, 2017 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yusufcakal/fa56ea4df976fb0ba8a460d6efd12784 to your computer and use it in GitHub Desktop.
Save yusufcakal/fa56ea4df976fb0ba8a460d6efd12784 to your computer and use it in GitHub Desktop.
Medium Post
try {
File file = new File("C:\\Users\\Yusuf\\IdeaProjects\\jaxb\\data.xml");
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
User user = (User) unmarshaller.unmarshal(file);
System.out.println(user + " " + user.getJob());
} catch (JAXBException e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment