public static void parseCommentToMap ( final String cellKey , final String newComment , final Map < String , Map < String , String > > sheetCommentMap , final boolean normalComment ) { if ( ( newComment != null ) && ( ! newComment . trim ( ) . isEmpty ( ) ) ) { // normal comment key is $$ String commentKey = TieConstants . NORMAL_COMMENT_KEY_IN_MAP ; if ( ! normalComment ) { // not normal comment. e.g. ${... or $init{... or // key = $ or key = $init commentKey = newComment . substring ( 0 , newComment . indexOf ( TieConstants . EL_START_BRACKET ) ) ; } Map < String , String > map = sheetCommentMap . get ( commentKey ) ; if ( map == null ) { map = new HashMap <> ( ) ; } // inner map's key is sheetName!$columnIndex$rowIndex map . put ( cellKey , newComment ) ; sheetCommentMap . put ( commentKey , map ) ; } }
Parse Comment To Map