public void writeDownloadSpreadsheetHeader ( List < TemplateTokenInfo > variableTokenNames ) { StringBuilder headerBuilder = new StringBuilder ( ) ; headerBuilder . append ( UPLOAD_COMMENTS ) ; headerBuilder . append ( "\n" ) ; for ( TemplateTokenInfo tokenInfo : variableTokenNames ) { if ( tokenInfo . getName ( ) . equals ( TemplateProcessorConstants . COMMENTS_TOKEN ) ) { headerBuilder . append ( "#The field '" + tokenInfo . getDisplayName ( ) + "' allows return characters. To add return characters add '<br>'; e.g. line1<br>line2" ) ; headerBuilder . append ( "\n" ) ; } } headerBuilder . append ( HEADER_TOKEN ) ; headerBuilder . append ( UPLOAD_DELIMITER ) ; for ( TemplateTokenInfo variable : variableTokenNames ) { headerBuilder . append ( variable . getDisplayName ( ) ) ; headerBuilder . append ( UPLOAD_DELIMITER ) ; } String headerLine = headerBuilder . toString ( ) ; headerLine = headerLine . substring ( 0 , headerLine . length ( ) - 1 ) ; //get rid of trailing delimiter this . lineWriter . println ( headerLine ) ; }
writes the header for the example download spreadsheet