001package com.avaje.ebean.text.json;
002
003/**
004 * Allows for customising the JSON write processing.
005 * <p>
006 * You can use this to add raw JSON content via {@link JsonWriter}.
007 * <p>
008 * You register a JsonWriteBeanVisitor with {@link JsonWriteOptions}.
009 * </p>
010 *
011 * @param <T>
012 *          the type of entity bean
013 *
014 * @see JsonWriteOptions
015 */
016public interface JsonWriteBeanVisitor<T> {
017
018  /**
019   * Visit the bean that has just been writing it's content to JSON. You can
020   * write your own additional JSON content to the JsonWriter if you wish.
021   *
022   * @param bean
023   *          the bean that has been writing it's content
024   * @param jsonWriter
025   *          the JsonWriter which you can append custom json content to if you
026   *          wish.
027   */
028  void visit(T bean, JsonWriter jsonWriter);
029
030}