Is There A Way To Get An ENUM Value Out Of A JSONObject?

edited February 2014 in Library Questions

I am trying to extract an enum value from a JSON file. I just automatically typed in getEnum("typeID") and quickly realized that's not something that exists. Is there any way to go about doing this?

Using Processing 2.1.1

Answers

  • Well, Json (and JavaScript) have no concept of enum, so you should indicate more precisely what kind of data you have, what it looks like.

    When the Jackson library is serializing a Java enum value, it just provides the string representation of the value.

    Or perhaps you have a simple list / array?

Sign In or Register to comment.