class MyJavaRulesDefinition implements RulesDefinition {

  @Override
  public void define(Context context) {
    NewRepository repository = context
      .createRepository(REPOSITORY_KEY, "java")
      .setName("MyCompany Custom Repository");

    for (Class<? extends JavaCheck> check : RulesList.getChecks()) {
      new RulesDefinitionAnnotationLoader().load(repository, check);
      newRule(check, repository);
    }
    repository.done();
  }

}