001package io.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> the type of entity bean
012 * @see JsonWriteOptions
013 */
014public interface JsonWriteBeanVisitor<T> {
015
016  /**
017   * Visit the bean that has just been writing it's content to JSON. You can
018   * write your own additional JSON content to the JsonWriter if you wish.
019   *
020   * @param bean       the bean that has been writing it's content
021   * @param jsonWriter the JsonWriter which you can append custom json content to if you
022   *                   wish.
023   */
024  void visit(T bean, JsonWriter jsonWriter);
025
026}