openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbJsonFactory.java
public final <T> OpenRtbJsonFactory register(OpenRtbJsonExtWriter<T> extWriter,
      Class<T> extKlass, Class<? extends Message> msgKlass, String fieldName) {
    Map<String, Map<String, OpenRtbJsonExtWriter<?>>> mapMsg = extWriters.get(msgKlass.getName());
    if (mapMsg == null) {
      extWriters.put(msgKlass.getName(), mapMsg = new LinkedHashMap<>());
    }
    Map<String, OpenRtbJsonExtWriter<?>> mapKlass = mapMsg.get(extKlass.getName());
    if (mapKlass == null) {
      mapMsg.put(extKlass.getName(), mapKlass = new LinkedHashMap<>());
    }
    mapKlass.put(fieldName == null ? FIELDNAME_ALL : fieldName, extWriter);
    return this;
  }
public final <T> OpenRtbJsonFactory register(OpenRtbJsonExtWriter<T> extWriter,
      Class<T> extKlass, Class<? extends Message> msgKlass, String fieldName) {
    Map<String, Map<String, OpenRtbJsonExtWriter<?>>> mapMsg = extWriters.get(msgKlass.getName());
    if (mapMsg == null) {
      extWriters.put(msgKlass.getName(), mapMsg = new LinkedHashMap<>());
    }
    Map<String, OpenRtbJsonExtWriter<?>> mapKlass = mapMsg.get(extKlass.getName());
    if (mapKlass == null) {
      mapMsg.put(extKlass.getName(), mapKlass = new LinkedHashMap<>());
    }
    mapKlass.put(fieldName == null ? FIELDNAME_ALL : fieldName, extWriter);
    return this;
  }
public final < T > OpenRtbJsonFactory register ( OpenRtbJsonExtWriter < T > extWriter , Class < T > extKlass , Class < ? extends Message > msgKlass , String fieldName ) { Map < String , Map < String , OpenRtbJsonExtWriter < ? > > > mapMsg = extWriters . get ( msgKlass . getName ( ) ) ; if ( mapMsg == null ) { extWriters . put ( msgKlass . getName ( ) , mapMsg = new LinkedHashMap <> ( ) ) ; } Map < String , OpenRtbJsonExtWriter < ? > > mapKlass = mapMsg . get ( extKlass . getName ( ) ) ; if ( mapKlass == null ) { mapMsg . put ( extKlass . getName ( ) , mapKlass = new LinkedHashMap <> ( ) ) ; } mapKlass . put ( fieldName == null ? FIELDNAME_ALL : fieldName , extWriter ) ; return this ; }
Register an extension writer, bound to a specific field name. This writer will be
used in preference to a non-field-specific writer that may exist for the same class.

@param extWriter code to serialize some {@code extKlass}'s properties
@param extKlass class of extension message, e.g. {@code MyImp.class}
@param msgKlass class of container message, e.g. {@code Imp.class}
@param fieldName name of the field containing the extension
@param <T> Type of value for the extension
@see #register(OpenRtbJsonExtWriter, Class, Class)
Register an extension writer bound to a specific field name . This writer will be used in preference to a non - field - specific writer that may exist for the same class .