Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.util.ajax
Class JSONEnumConvertor

    java.lang.Object
      org.mortbay.util.ajax.JSONEnumConvertor

All Implemented Interfaces:
  JSON.Convertor

    public class JSONEnumConvertor

extends java.lang.Object
implements 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.

Author:
  gregw

Constructor Summary
`JSONEnumConvertor()`
`JSONEnumConvertor(boolean fromJSON)`

Method Summary
`java.lang.Object` | `fromJSON(java.util.Map map)`
`void` | `toJSON(java.lang.Object obj, JSON.Output out)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JSONEnumConvertor

    public JSONEnumConvertor()

### JSONEnumConvertor

    public JSONEnumConvertor(boolean fromJSON)

Method Detail

### fromJSON

    public java.lang.Object fromJSON(java.util.Map map)

  Specified by:
    `fromJSON` in interface `JSON.Convertor`

### toJSON

    public void toJSON(java.lang.Object obj,
                       JSON.Output out)

  Specified by:
    `toJSON` in interface `JSON.Convertor`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.