@ RequiresNonNull ( "docFile" ) private String newDocFileText ( ) throws Exception { StringJoiner b = new StringJoiner ( lineSep ) ; BufferedReader doc = Files . newBufferedReader ( docFile . toPath ( ) , UTF_8 ) ; String docline ; boolean replacing = false ; boolean replacedOnce = false ; String prefix = null ; while ( ( docline = doc . readLine ( ) ) != null ) { if ( replacing ) { if ( docline . trim ( ) . equals ( endDelim ) ) { replacing = false ; } else { continue ; } } b . add ( docline ) ; if ( ! replacedOnce && docline . trim ( ) . equals ( startDelim ) ) { if ( formatJavadoc ) { int starIndex = docline . indexOf ( ' ' ) ; b . add ( docline . substring ( 0 , starIndex + 1 ) ) ; String jdoc = optionsToJavadoc ( starIndex , 100 ) ; b . add ( jdoc ) ; if ( jdoc . endsWith ( "</ul>" ) ) { b . add ( docline . substring ( 0 , starIndex + 1 ) ) ; } } else { b . add ( optionsToHtml ( 0 ) ) ; } replacedOnce = true ; replacing = true ; } } doc . close ( ) ; return b . toString ( ) ; }
Get the result of inserting the options documentation into the docfile .