简体   繁体   English

如何在 beans.xml 中使用 @JsonPropertyOrder 注解

[英]How to use @JsonPropertyOrder annotation in beans.xml

I want to order my Data transfer object(POJO) created using beans.xml.我想订购我使用 beans.xml 创建的数据传输对象 (POJO)。 can someone please tell me how to use @JsonPropertyOrder annotation in xml file rather than in Java?有人可以告诉我如何在 xml 文件而不是 Java 中使用 @JsonPropertyOrder 注释吗?

Thanks much in advance非常感谢提前

You can use the annotations element, like this:您可以使用 annotations 元素,如下所示:

<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:其他参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM