private void extendCG(Configuration config, List<Context> contexts) {
    // just use the extended comment generator

    PluginConfiguration pluginConfiguration = new PluginConfiguration();
    pluginConfiguration.setConfigurationType(CommentsWavePlugin.class.getTypeName());
    addToContext(contexts, pluginConfiguration);

    if (verbose) getLog().info("enable comment wave service");

    for (Context context : config.getContexts()) {
      context.getCommentGeneratorConfiguration().setConfigurationType(CommentGenerator.class.getTypeName());
      if (i18nPath != null && i18nPath.exists()) {
        context.getCommentGeneratorConfiguration().addProperty(CommentGenerator.XMBG_CG_I18N_PATH_KEY, i18nPath.getAbsolutePath());
      }
      if (StringUtils.isEmpty(projectStartYear)) {
        projectStartYear = CommentGenerator.XMBG_CG_PROJECT_START_DEFAULT_YEAR;
      }
      context.getCommentGeneratorConfiguration().addProperty(CommentGenerator.XMBG_CG_PROJECT_START_YEAR, projectStartYear);
      context.getCommentGeneratorConfiguration().addProperty(CommentGenerator.XMBG_CG_I18N_LOCALE_KEY, locale);
    }
    if (verbose) getLog().info("replace the origin comment generator");
  }
private void extendCG ( Configuration config , List < Context > contexts ) { PluginConfiguration pluginConfiguration = new PluginConfiguration ( ) ; pluginConfiguration . setConfigurationType ( CommentsWavePlugin . class . getTypeName ( ) ) ; addToContext ( contexts , pluginConfiguration ) ; if ( verbose ) getLog ( ) . info ( "enable comment wave service" ) ; for ( Context context : config . getContexts ( ) ) { context . getCommentGeneratorConfiguration ( ) . setConfigurationType ( CommentGenerator . class . getTypeName ( ) ) ; if ( i18nPath != null && i18nPath . exists ( ) ) { context . getCommentGeneratorConfiguration ( ) . addProperty ( CommentGenerator . XMBG_CG_I18N_PATH_KEY , i18nPath . getAbsolutePath ( ) ) ; } if ( StringUtils . isEmpty ( projectStartYear ) ) { projectStartYear = CommentGenerator . XMBG_CG_PROJECT_START_DEFAULT_YEAR ; } context . getCommentGeneratorConfiguration ( ) . addProperty ( CommentGenerator . XMBG_CG_PROJECT_START_YEAR , projectStartYear ) ; context . getCommentGeneratorConfiguration ( ) . addProperty ( CommentGenerator . XMBG_CG_I18N_LOCALE_KEY , locale ) ; } if ( verbose ) getLog ( ) . info ( "replace the origin comment generator" ) ; }
extend origin mbg the ability for generating comments