Reputation: 47
I want to order my Data transfer object(POJO) created using beans.xml. can someone please tell me how to use @JsonPropertyOrder annotation in xml file rather than in Java?
Thanks much in advance
Upvotes: 2
Views: 1150
Reputation: 3340
You can use the annotations element, like this:
<bean class="de.hybris.platform.couponfacades.data.AnnotatedPojo">
<import type="javax.xml.bind.annotation.XmlRootElement"/>
<import type="javax.xml.bind.annotation.XmlElements"/>
<import type="javax.xml.bind.annotation.XmlElement"/>
<annotations>@XmlRootElement</annotations>
<property name="someText" type="String">
<annotations scope="getter">
@XmlElements(value = {
@XmlElement(name="map",
type=ValueAsMap.class),
@XmlElement(name="string",
type=ValueAsString.class)
})
</annotations>
</property>
</bean>
Other reference:
Upvotes: 2