Package 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 java.lang.Object implements JSON.Convertor
Convert an Object to JSON using reflection on getters methods.
-
-
Constructor Summary
Constructors Constructor Description JSONObjectConvertor()
JSONObjectConvertor(boolean fromJSON)
JSONObjectConvertor(boolean fromJSON, java.lang.String[] excluded)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
fromJSON(java.util.Map map)
protected boolean
includeField(java.lang.String name, java.lang.Object o, java.lang.reflect.Method m)
void
toJSON(java.lang.Object obj, JSON.Output out)
-
-
-
Constructor Detail
-
JSONObjectConvertor
public JSONObjectConvertor()
-
JSONObjectConvertor
public JSONObjectConvertor(boolean fromJSON)
-
JSONObjectConvertor
public JSONObjectConvertor(boolean fromJSON, java.lang.String[] excluded)
- Parameters:
fromJSON
- true to convert from JSONexcluded
- An array of field names to exclude from the conversion
-
-
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
-
includeField
protected boolean includeField(java.lang.String name, java.lang.Object o, java.lang.reflect.Method m)
-
-