Package org.eclipse.jetty.util.ajax
Class JSONEnumConvertor
java.lang.Object
org.eclipse.jetty.util.ajax.JSONEnumConvertor
- All Implemented Interfaces:
JSON.Convertor
Convert an
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 Summary
-
Method Summary
-
Constructor Details
-
JSONEnumConvertor
public JSONEnumConvertor() -
JSONEnumConvertor
public JSONEnumConvertor(boolean fromJSON)
-
-
Method Details
-
fromJSON
- Specified by:
fromJSON
in interfaceJSON.Convertor
-
toJSON
- Specified by:
toJSON
in interfaceJSON.Convertor
-