public class JSONEnumConvertor extends java.lang.Object implements JSON.Convertor
Enum
to JSON.
If fromJSON is true in the constructor, the JSON generated will
be of the form {class="com.acme.TrafficLight",value="Green"}
If fromJSON is false, then only the string value of the enum is generated.Constructor and Description |
---|
JSONEnumConvertor() |
JSONEnumConvertor(boolean fromJSON) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
fromJSON(java.util.Map map) |
void |
toJSON(java.lang.Object obj,
JSON.Output out) |
public JSONEnumConvertor()
public JSONEnumConvertor(boolean fromJSON)
public java.lang.Object fromJSON(java.util.Map map)
fromJSON
in interface JSON.Convertor
public void toJSON(java.lang.Object obj, JSON.Output out)
toJSON
in interface JSON.Convertor
Copyright © 1995–2023 Webtide. All rights reserved.