Top Description Fields Constructors Methods
org.mortbay.util.ajax

public Class JSONObjectConvertor

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

Convert an Object to JSON using reflection on getters methods.
Author
gregw

Field Summary

Modifier and TypeField and Description
private Set<E>
private boolean

Constructor Summary

AccessConstructor and Description
public
public
JSONObjectConvertor(boolean fromJSON)

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

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 Set<E> _excluded
_fromJSONback to summary
private boolean _fromJSON

Constructor Detail

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

An array of field names to exclude from the conversion

Method Detail

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

Implements org.mortbay.util.ajax.JSON.Convertor.fromJSON.

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.mortbay.util.ajax.JSON.Convertor.toJSON.