我正在尝试将 xml 解析为 java 类,任何人都可以帮助我。 谢谢。
<?xml version="1.0" encoding="utf-8"?>
<patterns>
<pattern if="menuCondition">
<input>Menu</input>
<output>
<command if="taxCondition">Company</command>
<command>Tax</command>
<command>Customer</command>
<command>Vendor</command>
<command>Banking</command>
<command>Reports</command>
<command>Settings</command>
<command>Logout</command>
</output>
</pattern>
</patterns>
最佳答案
请看看这个SO question 。它有关于 Java 和 XML 的大量良好答案。
关于java - 使用 xstream 将 XML 解析为 java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8307286/