JAXB是否在内部使用SAX或DOM? [英] Does JAXB uses SAX or DOM internally?

查看:187
本文介绍了JAXB是否在内部使用SAX或DOM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到这个问题的答案,任何人都可以让我知道

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

由于JAXB是更高级别的API,JAXB是否在内部使用SAX或DOM? / p>

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

推荐答案

注意:我是 EclipseLink JAXB(MOXy) 领导和 JAXB 2(JSR-222) 专家组。

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

单个JAXB(JSR-222)实现可以自由选择用于不同输入的底层解析技术。我们在MOXy中使用的策略是使用StAX( javax.xml.stream )尽可能多。

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.

有多种方法可以控制JAXB impl使用的解析器。下面是我给出的答案的链接,解释了如何让JAXB impl使用特定的SAX解析器:

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:

  • How to disable DTD fetching using JAXB2.0

另一个答案解释如何确保使用StAX:

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

  • Make JAXB go faster

这篇关于JAXB是否在内部使用SAX或DOM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆