All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jodd.json.impl.ObjectJsonSerializer Maven / Gradle / Ivy

// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.json.impl;

import jodd.json.BeanSerializer;
import jodd.json.JsonContext;

/**
 * Main serializer for objects. It is also the last serializer, used when
 * no other serializer is found.
 */
public class ObjectJsonSerializer extends ValueJsonSerializer {

	public void serializeValue(final JsonContext jsonContext, Object value) {
		jsonContext.writeOpenObject();

		BeanSerializer beanVisitor = new BeanSerializer(jsonContext, value);
		beanVisitor.serialize();

		jsonContext.writeCloseObject();
	}

}