public JInvocation createAddToSerializeToExpression( @Nonnull AbstractGenerator<?> generator, @Nonnull JDefinedClass serializerClass, @Nonnull JExpression serializeTo, @Nonnull FieldDeclarationInfo fieldInfo, @Nonnull JVar object, JVar formatVersion ) {
generator.addDelegatingSerializerToConstructor( serializerClass, codeGenerator.ref( TypeUtils.getErasure( fieldInfo.getCollectionParam() ).toString() ) );
JFieldVar constant = getConstant( serializerClass, fieldInfo );
JInvocation getterInvocation = codeGenerator.createGetterInvocation( object, fieldInfo );
return JExpr.invoke( METHOD_NAME_SERIALIZE )
.arg( getterInvocation )
.arg( JExpr.dotclass( codeGenerator.ref( fieldInfo.getCollectionParam().toString() ) ) )
.arg( constant )