question

Upvotes
Accepted
25 2 0 4

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 ?

elektronrefinitiv-realtimeelektron-sdkenum
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
9.5k 10 5 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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea