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 .