protected boolean writeCustom ( Class arrayComponentClass , Object o , boolean showType , Writer output ) throws IOException { if ( neverShowType ) { showType = false ; } JsonClassWriterBase closestWriter = getCustomWriter ( arrayComponentClass ) ; if ( closestWriter == null ) { return false ; } if ( writeOptionalReference ( o ) ) { return true ; } boolean referenced = objsReferenced . containsKey ( o ) ; if ( closestWriter instanceof JsonClassWriter ) { JsonClassWriter writer = ( JsonClassWriter ) closestWriter ; if ( writer . hasPrimitiveForm ( ) ) { if ( ( ! referenced && ! showType ) || closestWriter instanceof Writers . JsonStringWriter ) { if ( writer instanceof Writers . DateWriter ) { ( ( Writers . DateWriter ) writer ) . writePrimitiveForm ( o , output , args ) ; } else { writer . writePrimitiveForm ( o , output ) ; } return true ; } } } output . write ( ' ' ) ; tabIn ( ) ; if ( referenced ) { writeId ( getId ( o ) ) ; if ( showType ) { output . write ( ' ' ) ; newLine ( ) ; } } if ( showType ) { writeType ( o , output ) ; } if ( referenced || showType ) { output . write ( ' ' ) ; newLine ( ) ; } if ( closestWriter instanceof JsonClassWriterEx ) { ( ( JsonClassWriterEx ) closestWriter ) . write ( o , showType || referenced , output , args ) ; } else { ( ( JsonClassWriter ) closestWriter ) . write ( o , showType || referenced , output ) ; } tabOut ( ) ; output . write ( ' ' ) ; return true ; }
Perform the actual custom writing for an array element that has a custom writer .