• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXB Parser

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which parser is used by JAXB to Marshalling & unMarshalling
Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think JAXB comes with its own parser, so it would rely on the one JAXP supplies. Depending on the JRE version, that could be Crimson or Xerces.
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
Ulf Dittmer but in JAXB tutorial JAXB a StAX, which provides a standard, bidirectional pull parser interface for streaming XML processing.
Is there any way through which I can define which Parser should use for marshaling & unmarshalling.
thanks
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,All
There is StaX API is defined in JWS Tutorials (V1.6).
Is this API used to parse & update the XML

Thanks
Vijay Kumar
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you want to specify which parser JAXB should use? Note that a parser can only read XML, not generate it.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
StAX: "Streaming API for XML" - that means it is an API for reading and writing XML streams. StAX may very well do it's own "parsing" (rather than relying on a pre-existing parser) - or are you trying control the StAX implementation that is being used? If so why?

The SAX parser returned by the javax.xml.parsers.SAXParserFactory is controlled by the "javax.xml.parsers.SAXParserFactory" system property but code can easily bypass that by looking for a specific parser implementation.

StAX's javax.xml.stream.XMLInputFactory has its own set of system properties that influence its behavior but none of them specify a "parser".

I'm also not aware that JAXB was ever required to use any XML manipulation technology in particular. There always has been the suggestion that JAXB would use something like SAX or StAX in order to maximize speed and minimize the memory footprint but the implementation was always free to do its "own thing".

Kohsuke Kawaguchi's Blog

This release is also the fastest JAXB RI release ever. Both the unmarshaller and marshaller were implemented pretty much from scratch for 2.0. The marshaller in particular has a brand-new algorithm highly optimized for UTF-8. It's so fast that at one point (maybe it still is) faster then our own FastInfoset.


[ August 02, 2007: Message edited by: Peer Reynders ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic