public void outputTerms ( ) throws DITAOTException { StringBuilder buff = new StringBuilder ( outputFileRoot ) ; AbstractWriter abstractWriter = null ; if ( indexClass != null && indexClass . length ( ) > 0 ) { //Instantiate the class value Class < ? > anIndexClass ; try { anIndexClass = Class . forName ( indexClass ) ; abstractWriter = ( AbstractWriter ) anIndexClass . newInstance ( ) ; final IDitaTranstypeIndexWriter indexWriter = ( IDitaTranstypeIndexWriter ) anIndexClass . newInstance ( ) ; //RFE 2987769 Eclipse index-see try { ( ( AbstractExtendDitaWriter ) abstractWriter ) . setPipelineHashIO ( this . getPipelineHashIO ( ) ) ; } catch ( final ClassCastException e ) { javaLogger . info ( e . getMessage ( ) ) ; javaLogger . info ( e . toString ( ) ) ; e . printStackTrace ( ) ; } buff = new StringBuilder ( indexWriter . getIndexFileName ( outputFileRoot ) ) ; } catch ( final ClassNotFoundException | InstantiationException | IllegalAccessException e ) { e . printStackTrace ( ) ; } } else { throw new IllegalArgumentException ( "Index writer class not defined" ) ; } //Even if there is no term in the list create an empty index file //otherwise the compiler will report error. abstractWriter . setLogger ( javaLogger ) ; ( ( IDitaTranstypeIndexWriter ) abstractWriter ) . setTermList ( this . getTermList ( ) ) ; abstractWriter . write ( new File ( buff . toString ( ) ) ) ; }
Output index terms into index file .