Package org.eclipse.jetty.util.ajax
Class JSONEnumConvertor
- java.lang.Object
-
- org.eclipse.jetty.util.ajax.JSONEnumConvertor
-
- All Implemented Interfaces:
JSON.Convertor
public class JSONEnumConvertor extends java.lang.Object implements JSON.Convertor
Convert anEnum
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
Constructors Constructor Description JSONEnumConvertor()
JSONEnumConvertor(boolean fromJSON)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
fromJSON(java.util.Map map)
void
toJSON(java.lang.Object obj, JSON.Output out)
-
-
-
Method Detail
-
fromJSON
public java.lang.Object fromJSON(java.util.Map map)
- Specified by:
fromJSON
in interfaceJSON.Convertor
-
toJSON
public void toJSON(java.lang.Object obj, JSON.Output out)
- Specified by:
toJSON
in interfaceJSON.Convertor
-
-