6

I could not find answer for this question , could anybody please let me know

Since JAXB is an higher level API , does JAXB uses SAX or DOM internally ?

Pawan
  • 31,545
  • 102
  • 256
  • 434
  • As Blaise points out, JAXB is an interface, not an implementation. You'll have to ask your question in relation to a specific implementation. – Michael Kay Mar 29 '12 at 13:36
  • So maybe a better question would be what parser does the reference JAXB implementation use (the one in the JDK since Java 1.6) – Michael Dec 11 '12 at 17:44

1 Answers1

12

Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.

Individual JAXB (JSR-222) implementations are free to choose the underlying parsing technologies they use for different inputs. The strategy we use in MOXy is to use StAX (javax.xml.stream) as much as possible.

There are ways to control what parser your JAXB impl uses. Below is a link to an answer I gave explaining how to get a JAXB impl to use a specific SAX parser:

And another answer explaining how to ensure that StAX is used:

Community
  • 1
  • 1
bdoughan
  • 147,609
  • 23
  • 300
  • 400