java - in JAXB, can I create one Unmarshaller instance and use it to unmarshall xml nodes or files many times? -


I use the SAC to parse a large XML file which is large and has several repeating nodes and JAXB Use persuasion to paraphrase javabeans and duplicate dom nodes map.

Here is my code snippet. I use a code of partial unmarshalling of JSASB, it creates the Unmoderner object every time a node is started parsing. Can I reuse it for an entire XML parsing or can I cache it for multiple XML parsing?

& Amp; amp; & amp; Local Names.Ajals (A Product) ???) {Unmarshaller unmarshaller = null; Try {// I want to reuse it, do not create it in the initial method at every start- jaxbContext.createUnmarshaller (); } Hold (JAXBException e) {new SAXException (E); } ...

Unless your JAXBContext changes, Unmarshaller can reuse

Also see. In this there is an example which reuses the same unmarshaller for mulitple XML files, only when the reference ( BazObject package is not on the reference path), you will need to create a new unmarshaller from different references.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -