public class

DefaultJsonator

extends Object
implements Jsonator<T>
java.lang.Object
   ↳ com.atlassian.confluence.json.jsonator.DefaultJsonator

Class Overview

Converts a Java Bean to a JSON object.

The process is roughly as follows:

  1. Remove any AspectJ wrapping around the Bean,
  2. Call all getter methods on the Bean, storing to a Map
  3. As each getter is called, run the returned object through a jsonator specific to the object class (eg. Page)
  4. Each jsonator creates a JSON object implementing the Json interface
  5. Once all Bean properties are in the top-level JSON Object, the object is serialized recursively
The first step, calling the getter methods, is delegated to a JSONObject, which converts a bean Object into a JSONObject map.

Summary

Public Constructors
DefaultJsonator(Map<Class<?>, Jsonator<?>> jsonators)
Creates a jsonator with the DefaultIntrospector and provided jsonators.
DefaultJsonator(Introspector introspector, Map<Class<?>, Jsonator<?>> jsonators)
Public Methods
Json convert(Object bean)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.json.jsonator.Jsonator

Public Constructors

public DefaultJsonator (Map<Class<?>, Jsonator<?>> jsonators)

Creates a jsonator with the DefaultIntrospector and provided jsonators. Use DefaultJsonator(Introspector, Map) to specify your own Introspector.

public DefaultJsonator (Introspector introspector, Map<Class<?>, Jsonator<?>> jsonators)

Public Methods

public Json convert (Object bean)