The code snippet shown in Listing 7 is a test driver that exercises the xml2json converterlogic.
清单7中的代码片段是一个用于执行xml2json转换器逻辑的测试驱动程序。
2
Your goal is to create a converter that is easy to extend to handle additional formats and that keeps logic for any particular input or output format as separate as possible.
We prefer the latter option because it allows us to simply associate a custom converter (with built-in validation logic) with a specific object type and have JSF handle that object type.