正在消除maxOccurs的收集节点的生成=";无界的;java中Jackson的收藏
如果我要生成一个模式,如:正在消除maxOccurs的收集节点的生成=";无界的;java中Jackson的收藏,java,xml,serialization,jackson,Java,Xml,Serialization,Jackson,如果我要生成一个模式,如: <xsd:complexType name="address_listType"> <xsd:sequence> <xsd:element name="input_location" type="input_locationType" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType>
<xsd:complexType name="address_listType">
<xsd:sequence>
<xsd:element name="input_location" type="input_locationType"
maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
我得到:
<input_location>
<input_location x="X:4" multimatchNumber="1000" id="ID:1" latitude="80.2" longitude="44.1" srid="SRID: 5" y="Y:2">
</input_location>
</input_location>
但是考虑到我必须生成的模式,我不希望集合为自己输出一个节点,只为集合中的每个元素输出一个节点
如何告诉jackson不要为集合本身生成节点?找到它:
@JacksonXmlElementWrapper(useWrapping = false)
<input_location>
<input_location x="X:4" multimatchNumber="1000" id="ID:1" latitude="80.2" longitude="44.1" srid="SRID: 5" y="Y:2">
</input_location>
</input_location>
@JacksonXmlElementWrapper(useWrapping = false)