I want to implement a method which returns JAXBElement following is the code
@XmlRootElement(name = "history")
@XmlAccessorType(XmlAccessType.FIELD)
public class IBHistoryInfo {
@XmlElement(name="trade")
private List<IBTradeInfo> mTrade;
public void updateTradeValue(int reqId, String date, double open, double high, double low,
double close, int volume, int count, double WAP, boolean hasGaps){
IBTradeInfo info = new IBTradeInfo();
info.setReqId(reqId);
info.setDate(date);
info.setOpen(open);
info.setHigh(high);
info.setLow(low);
info.setClose(close);
info.setVolume(volume);
info.setCount(count);
info.setWap(WAP);
info.setHasGaps(hasGaps);
this.setTradeInfo(info);
}
public void setTradeInfo(IBTradeInfo tradeinfo){
mTrade.add(tradeinfo);
}
public List<IBTradeInfo> getTradeInfo(){
if (mTrade == null) {
mTrade = new ArrayList<IBTradeInfo>();
}
return this.mTrade;
}
}
Now i don't know how to creat a method which returns JAXBElement in the above class
for example
public JAXBElement<IBTradeInfo> getTradeXML(){
return mTrade
}