public void serialize(List<T> list,JsonGenerator jsonGenerator) throws IOException {
  jsonGenerator.writeStartArray();
  for (  T object : list) {
    if (object != null) {
      serialize(object,jsonGenerator,true);
    }
 else {
      jsonGenerator.writeNull();
    }
  }
  jsonGenerator.writeEndArray();
}

public void serialize ( List < T > list , JsonGenerator jsonGenerator ) throws IOException { jsonGenerator . writeStartArray ( ) ; for ( T object : list ) { if ( object != null ) { serialize ( object , jsonGenerator , true ) ; } else { jsonGenerator . writeNull ( ) ; } } jsonGenerator . writeEndArray ( ) ; }
serialize a list of objects to a jsongenerator .
