简体   繁体   English

Java批注-方法返回类型名称空间

[英]Java annotation - method return type namespace

I have property in my class defined like: 我在类中定义了如下属性:

    @XmlElementWrapper(name="cellValues")
    @XmlElement(name="cellValue")
    protected ArrayList<String[]> getCellValues()

When I use javaToWs it generate new complexType for Arraylist what is fine with me, but I would like to set a namespace for it... because default NS is http://jaxb.dev.java.net/array 当我使用javaToWs时,它会为Arraylist生成新的complexType,这对我来说很好,但是我想为其设置一个命名空间...因为默认的NS是http://jaxb.dev.java.net/array

Thanks 谢谢

You can use @XmlRootElement annotation for specific namespace. 您可以将@XmlRootElement批注用于特定的名称空间。

Check this url . 检查此网址

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

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