Logo Search packages:      
Sourcecode: gant version File versions

void org::codehaus::gant::GantBuilder::setMessageOutputLevel (  )  [inline]

Method to be called to trigger setting of the message output level on the AntBuilder project. The verbosity level is determined from GantState.

Definition at line 98 of file GantBuilder.java.

                                        {
    try {
      //  The project is a private field in AntBuilder so we have to use reflection to get at it.  Maybe it
      //  would be easier if this were a Groovy class :-)
      final Field field = getClass ( ).getSuperclass ( ).getDeclaredField ( "project" ) ;
      field.setAccessible ( true ) ;
      final Project project = (Project) field.get ( this ) ;
      final List<?> listeners = project.getBuildListeners ( ) ;
      assert listeners.size ( ) == 1 ;
      final BuildLogger logger = (BuildLogger) listeners.get ( 0 ) ;
      logger.setMessageOutputLevel ( GantState.verbosity ) ;
    }
    catch ( final NoSuchFieldException nsfe ) {
      throw new RuntimeException ( "No field named project in GantBuilder." ) ;
    }
    catch ( final IllegalAccessException iae ) {
      throw new RuntimeException ( "Unable to access field project in GantBuilder." ) ;
    }
  }


Generated by  Doxygen 1.6.0   Back to index