Top Description Fields Constructors Methods
org.eclipse.jetty.util.ajax

public Class JSONObjectConvertor

extends Object
implements Convertor
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.ajax.JSON.Convertor
Imports
java.lang.reflect.Method, .Modifier, java.util.Locale, .Map, .Set, org.eclipse.jetty.util.ajax.JSON.Output

Converts an Object to JSON using reflection on getters methods.

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
JSONObjectConvertor(boolean fromJSON)

public
JSONObjectConvertor(boolean
true to convert from JSON
fromJSON
,
String[]
An array of field names to exclude from the conversion
excludedFieldNames
)

Method Summary

Modifier and TypeMethod and Description
public Object
protected boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_excludedback to summary
private final Set<String> _excluded
_fromJSONback to summary
private final boolean _fromJSON

Constructor Detail

JSONObjectConvertorback to summary
public JSONObjectConvertor()
JSONObjectConvertorback to summary
public JSONObjectConvertor(boolean fromJSON)
JSONObjectConvertorback to summary
public JSONObjectConvertor(boolean fromJSON, String[] excludedFieldNames)
Parameters
fromJSON:boolean

true to convert from JSON

excludedFieldNames:String[]

An array of field names to exclude from the conversion

Method Detail

fromJSONback to summary
public Object fromJSON(Map<String, Object> map)

Implements org.eclipse.jetty.util.ajax.JSON.Convertor.fromJSON.

Annotations
@Override
includeFieldback to summary
protected boolean includeField(String name, Object o, Method m)
toJSONback to summary
public void toJSON(Object obj, JSON.Output out)

Implements org.eclipse.jetty.util.ajax.JSON.Convertor.toJSON.

Annotations
@Override