[Quickfix-developers] checking for field before getting it?
Brought to you by:
orenmnero
|
From: Rob K. <ro...@ri...> - 2003-02-28 17:59:35
|
is there a way to check if a field exists in a message before trying to =
extract it. For example the following code extracts FIX info into a =
data structure. if one of the fields I try to extract are missing, my =
app will send a reject message. without looking at the actual fix =
message string, I would like to see if a field is there before I try to =
get it. If a particular field is not there, I can maybe fill it in with =
the correct data. Any help would be appreciated.
public void Update(Fix42.SecurityStatus inMsg){
if(inMsg !=3D null)
{
mSymbol =3D inMsg.getSymbol();
mSecurityID =3D inMsg.getSecurityID();
mSecurityType =3D inMsg.getSecurityType();
mTradingSessionID =3D inMsg.getTradingSessionID();
mUnsolicitedUndicator =3D inMsg.getUnsolicitedIndicator();
mSecurityTradingstatus =3D inMsg.getSecurityTradingStatus();
//mTransactTime =3D inMsg.getTransactTime();
//mSecurityExchange =3D inMsg.getSecurityExchange();
//mSecurityDesc =3D inMsg.getSecurityDesc();
switch(mSecurityType.getValue())
{
case "OPT":
mMaturityMonthYear =3D inMsg.getMaturityMonthYear();
mMaturityDay =3D inMsg.getMaturityDay();
mPutOrCall =3D inMsg.getPutOrCall();
mStrikePrice =3D inMsg.getStrikePrice();
break;
case "FUT":
mMaturityMonthYear =3D inMsg.getMaturityMonthYear();
mMaturityDay =3D inMsg.getMaturityDay();
break;
}
}=09
}
|