public void compileAll ( ) { if ( this . generatedClassList . isEmpty ( ) ) { this . errorHandlers . clear ( ) ; return ; } final String [ ] classes = new String [ this . generatedClassList . size ( ) ] ; this . generatedClassList . toArray ( classes ) ; File dumpDir = this . configuration . getPackageBuilderConfiguration ( ) . getDumpDir ( ) ; if ( dumpDir != null ) { dumpResources ( classes , dumpDir ) ; } final CompilationResult result = this . compiler . compile ( classes , this . src , this . packageStoreWrapper , rootClassLoader ) ; //this will sort out the errors based on what class/file they happened in if ( result . getErrors ( ) . length > 0 ) { for ( int i = 0 ; i < result . getErrors ( ) . length ; i ++ ) { final CompilationProblem err = result . getErrors ( ) [ i ] ; final ErrorHandler handler = this . errorHandlers . get ( err . getFileName ( ) ) ; handler . addError ( err ) ; } final Collection errors = this . errorHandlers . values ( ) ; for ( Object error : errors ) { final ErrorHandler handler = ( ErrorHandler ) error ; if ( handler . isInError ( ) ) { this . results . add ( handler . getError ( ) ) ; } } } // We've compiled everthing, so clear it for the next set of additions this . generatedClassList . clear ( ) ; this . errorHandlers . clear ( ) ; }
This actually triggers the compiling of all the resources . Errors are mapped back to the element that originally generated the semantic code .