Skip to content

Instantly share code, notes, and snippets.

@KomanRudden
Last active February 11, 2016 09:44
Show Gist options
  • Save KomanRudden/e4939be51330d0270a3e to your computer and use it in GitHub Desktop.
Save KomanRudden/e4939be51330d0270a3e to your computer and use it in GitHub Desktop.
Parsing from XML to JAXB object
JAXBContext jaxbContext = JAXBContext.newInstance(<theObject>.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
StringReader reader = new StringReader(<thingToMarshall>);
<theObject> root = (<theObject>) unmarshaller.unmarshal(reader);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment