这是我的豆子
package mypackage;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement
@XmlType(propOrder={"columnName", "new_value"})
public class GetUserInfoResponse {
private String columnName;
private String new_value;
@XmlElement(nillable = true, name = "nomChamps")
public String getColumnName() {
return columnName;
}
@XmlElement(nillable = true, name = "ValeurModifiee")
public String getNew_value() {
return new_value;
}
}
这就是我得到的结果
{
"getUserInfoResponse": [
{
"nomChamps": "AD_Client_ID",
"ValeurModifiee": ""
},
{
"nomChamps": "AD_Org1_ID",
"ValeurModifiee": ""
}
]
}
我变得像标题getUserInfoResponse
(类java bean的名称)
现在,我想获得一个特定的标题(在类java名称的位置示例values
)
答案 0 :(得分:4)
简单
@XmlRootElement(name="values")