Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 XML 模式文件,并从中生成类。生成的类总是公开的。我想要的是只让类包可见。这可能吗 ?如果是,请给我一个提示。
谢谢!
您可以编写一个 XJC 插件来完成此操作:
使用 wsimport 时,只能生成公共类。因此,如果您想让它们受到包保护,那么您唯一的选择是在生成的文件中搜索/替换。但是,根据您要对生成的类执行的操作,对它们进行包保护可能没有意义。