public String buildHeaderLine ( boolean appendLineTermination ) { checkEntityConfig ( ) ; StringBuilder sb = new StringBuilder ( ) ; boolean first = true ; for ( ColumnInfo < ? > columnInfo : allColumnInfos ) { if ( first ) { first = false ; } else { sb . append ( columnSeparator ) ; } String header = columnInfo . getColumnName ( ) ; // need to protect the column if it contains a quote if ( header . indexOf ( columnQuote ) >= 0 ) { writeQuoted ( sb , header ) ; continue ; } sb . append ( columnQuote ) ; sb . append ( header ) ; sb . append ( columnQuote ) ; } if ( appendLineTermination ) { sb . append ( lineTermination ) ; } return sb . toString ( ) ; }
Build and return a header string made up of quoted column names .