org.eclipse.jetty.util.ajax

## Class JSONObjectConvertor

- java.lang.Object
- - org.eclipse.jetty.util.ajax.JSONObjectConvertor

- All Implemented Interfaces:
    JSON.Convertor

      public class JSONObjectConvertor
      extends Object
      implements JSON.Convertor

  Convert an Object to JSON using reflection on getters methods.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONObjectConvertor()`
    `JSONObjectConvertor(boolean fromJSON)`
    `JSONObjectConvertor(boolean fromJSON, String[] excluded)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `fromJSON(Map map)`
    `protected boolean` | `includeField(String name, Object o, Method m)`
    `void` | `toJSON(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

    - #### JSONObjectConvertor

          public JSONObjectConvertor()

    - #### JSONObjectConvertor

          public JSONObjectConvertor(boolean fromJSON)

    - #### JSONObjectConvertor

          public JSONObjectConvertor(boolean fromJSON,
                             String[] excluded)

      Parameters:
        `fromJSON` -
        `excluded` - An array of field names to exclude from the conversion

  - ### Method Detail

    - #### fromJSON

          public Object fromJSON(Map map)

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

    - #### toJSON

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

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

    - #### includeField

          protected boolean includeField(String name,
                             Object o,
                             Method m)

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