question

Upvotes
Accepted
25 5 4 7

where to take ENUM names for enum Currency

I got Field like this:

, FieldEntry fid="15" name="CURRENCY" dataType="Enum" value="978"

and I need to convert 978 to some currency ISO code,

where I can look up a dictionary ?

refinitiv-realtimeelektronelektron-sdkenum
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
9.6k 10 7 7

Hello @monakhov

The Enum displays(names) are in the dictionary file named enumtype.def. Anyway, EMA downloads this dictionary from the server automatically by default. To get the Enum display according to its value, just call FieldEntry.enumDisplay(). FieldEntry is in com.thomsonreuters.ema.access package.

The example snipped source code:

//in onRefreshMsg(..) and onUpdateMsg(..)
decode(msg.payload().fieldList());
...
void decode(FieldList fieldList)
{
	for (FieldEntry fieldEntry : fieldList)
	{
	  System.out.print("Fid: " + fieldEntry.fieldId() + " Name = " + fieldEntry.name() + " DataType: " + DataType.asString(fieldEntry.load().dataType()) + " Value: ");
           if (Data.DataCode.BLANK == fieldEntry.code())
	      System.out.println(" blank");
	  else
	    switch (fieldEntry.loadType())
	    {
		...
		case DataTypes.ENUM :
		System.out.println(fieldEntry.hasEnumDisplay() ? fieldEntry.enumDisplay() : fieldEntry.enumValue());
		break;
		...
	     }
	}
}

You can see the complete application source code in AppClient class of example360__MarketPrice__View that I have suggested you in your previous question.

Hope this help.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.