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

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

问题描述

我找不到这个问题的答案,有没有人可以告诉我

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

既然 JAXB 是一个更高级别的 API,那么 JAXB 是在内部使用 SAX 还是 DOM?

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:

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

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

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

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