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.
谁能告诉如何从一些 Java bean 生成 ObjectFactory 类?请记住,我没有 xsd,因此我不能使用 JAXB。
JAXB (JSR-222) 实现所做的唯一类生成是来自 XML 模式。从 Java 类开始时,您只需要创建一个类并对其进行注释@XmlRegistry。您需要将此类包含在用于引导JAXBContext. 这样做的主要原因是利用@XmlElementDecl注释将多个根元素与一个类相关联。这是你想要做的吗?
@XmlRegistry
JAXBContext
@XmlElementDecl