protected final void writeContentCategories ( String fieldName , List < String > cats , JsonGenerator gen ) throws IOException { if ( ! cats . isEmpty ( ) ) { gen . writeArrayFieldStart ( fieldName ) ; for ( String cat : cats ) { writeContentCategory ( cat , gen ) ; } gen . writeEndArray ( ) ; } }
Writes an array of ContentCategory if not empty .