我有用於獲取實例三類JAXB解組使用@XMLJavaTypeAdapters
@XmlRootElement
public class GeofenceParameter{
private GeofenceCenterAddress geofenceCenterAddress;
private GeofenceCenterCoordinates geofenceCenterCoordinates;
}
public class GeofenceCenterAddress extends GeofenceParameter{
}
public class GeofenceCenterCoordinate extends GeofenceParameter{
}
我在GeofenceCenterAddress而GeofenceCentereCoordinate
Class forGeofenceCenterCoordinate extends XmlAdapter<ValueType,BoundType>{
}
Class forGeofenceCenterAddress extends XmlAdapter<ValueType,BoundType>{
}
由兩種不同的XmlAdapter擴展類編組和解組在地理圍欄Paramtere根據Soap請求發送,從GeofenceParamter中選擇GeofenceCenterAddress或GeofenceCenterCoordinate類。
爲此,我已經使用註釋在package-info.java文件@XmlJavaTypeAdapters{(@XmlJavaTypeAdapter(type=forGeofenceCenterCoordinate)),@XmlJavaTypeAdapter(type=forGeofenceCenterAddress)}
,但在Web服務,它會給我,我已經在這個@XmlJavaTypeAdapter(type=forGeofenceCenterCoordinate) class not of @XmlJavaTypeAdapter(type=forGeofenceCenterAddress)
從GeofenceParamter的註解即指定拳頭類的實例。
可以請幫助我在JAXB繼承編組和解組中編寫第二類實例。
在此先感謝