【发布时间】:2017-06-02 03:16:02
【问题描述】:
我需要使用“factoryMethod”来解决“两个声明导致 ObjectFactory 类中的冲突。”。但是,我收到“编译器无法实现此 factoryMethod 自定义”。我找不到有关“factoryMethod”的信息。看来我没有正确使用它。请看我的简化架构:
<?xml version='1.0' encoding='UTF-8' ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.1">
<xs:element name="UseCase">
<xs:complexType>
<xs:sequence>
<xs:element name="StepAction" >
<xs:annotation>
<xs:appinfo>
<jxb:factoryMethod name="createStepAction" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
我使用“xjc %schemaname%”来生成类。
【问题讨论】: