001package io.avaje.json.view;
002
003import java.lang.invoke.MethodHandle;
004
005/**
006 * A (non-scalar) JsonAdapter that is part of building json views.
007 * <p>
008 * JsonAdapters for complex types that have more than one property like
009 * CustomerJsonAdapter, AddressJsonAdapter can participate in building
010 * a json view that will include only some of their properties.
011 */
012public interface ViewBuilderAware {
013
014  /**
015   * Build view for the top level.
016   */
017  default void build(ViewBuilder builder) {
018    build(builder, null, null);
019  }
020
021  /**
022   * Build nested part of the view.
023   */
024  void build(ViewBuilder builder, String name, MethodHandle handle);
025
026}