[Quickfix-developers] Creating arbitrary typed fields in Java
Brought to you by:
orenmnero
|
From: Graham M. <gm...@de...> - 2005-05-03 23:35:40
|
Hello all,=20
I'm trying to create an arbitrary field in an arbitrary QuickFIX message =
for the purposes of passing some fields straight through my app from my =
end user to my counterparty. That is, I want to copy all of the extra =
fields in an incoming non-QuickFIX message into a new QuickFIX message, =
without needing to know ahead of time what type the fields are.
I'm working in Java-land, so bear with me (the Java API, not the Java =
port of QuickFIX).
Here's what I want to do--imagine it's in a loop copying all the =
fields... (does not compile):
quickfix.Message aMessage =3D getMessageFromSomewhereElse();
Field aField =3D new Field(
someFieldIdentifier, // for example 201, PutOrCall, but could be =
any valid field ID
someObject // in this example, an Integer, 0, Put
);
aMessage.setField(aField);
But unfortunately there's no setField method overloaded to take just a =
Field. There are overloaded versions that can take any of the =
subclasses of Field, but that doesn't help me very much, because I want =
to try to avoid having to determine the type.
It may be the case that I can't get around determining the type myself =
(but it seems that there should be a way). In that case, I am guessing =
that I need to use an explicit DataDictionary, loaded up with the =
version of FIX I'm interested in. There doesn't seem to be a way to get =
a default data dictionary from the MessageFactory, for example. Even =
then, after calling getFieldType(int fieldID), I am left with an integer =
specifier of the type, which there doesn't seem to be a good way to map =
to the subclasses of Field.
Thanks in advance for any help you can provide.
graham
This message is intended only for the personal and confidential use of =
the designated recipient(s) named above. If you are not the intended =
recipient of this message you are hereby notified that any review, =
dissemination, distribution or copying of this message is strictly =
prohibited. This communication is for information purposes only and =
should not be regarded as an offer to sell or as a solicitation of an =
offer to buy any financial product, an official confirmation of any =
transaction, or as an official statement of Del Mar Asset Management. =
Email transmission cannot be guaranteed to be secure or error-free. =
Therefore, we do not represent that this information is complete or =
accurate and it should not be relied upon as such. All information is =
subject to change without notice.=20
|