private void createMessageElement ( StringBuilder sb , RepositoryLogRecord record ) { // 660484 elim string concat sb . append ( lineSeparator ) . append ( INDENT [ 0 ] ) . append ( "<msgDataElement msgLocale=\"" ) . append ( record . getMessageLocale ( ) ) . append ( "\">" ) ; if ( record . getParameters ( ) != null ) { // how many params do we have? for ( int c = 0 ; c < record . getParameters ( ) . length ; c ++ ) { sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgCatalogTokens value=\"" ) . append ( MessageFormat . format ( "{" + c + "}" , record . getParameters ( ) ) ) . append ( "\"/>" ) ; } } // IBM SWG MsgID if ( record . getMessageID ( ) != null ) { // Seems to be a IBM SWG ID. sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgId>" ) . append ( record . getMessageID ( ) ) . append ( "</msgId>" ) ; // IBM SWG MsgType sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgIdType>" ) ; if ( record . getMessageID ( ) . length ( ) == 10 ) sb . append ( "IBM5.4.1" ) ; else sb . append ( "IBM4.4.1" ) ; sb . append ( "</msgIdType>" ) ; } if ( record . getRawMessage ( ) != null && record . getResourceBundleName ( ) != null ) { sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgCatalogId>" ) . append ( record . getRawMessage ( ) ) . append ( "</msgCatalogId>" ) ; sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgCatalogType>Java</msgCatalogType>" ) ; sb . append ( lineSeparator ) . append ( INDENT [ 1 ] ) . append ( "<msgCatalog>" ) . append ( record . getResourceBundleName ( ) ) . append ( "</msgCatalog>" ) ; } sb . append ( lineSeparator ) . append ( INDENT [ 0 ] ) . append ( "</msgDataElement>" ) ; }
Appends the CBE Message Element XML element of a record to a String buffer