Codota Logo
SqaleXmlLoader.load
Code IndexAdd Codota to your IDE (free)

How to use
load
method
in
org.sonar.squidbridge.rules.SqaleXmlLoader

Best Java code snippets using org.sonar.squidbridge.rules.SqaleXmlLoader.load (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: Backelite/sonar-swift

@Override
public void define(Context context) {
  NewRepository repository = context.createRepository(REPOSITORY_KEY, ObjectiveC.KEY).setName(REPOSITORY_NAME);
  try(BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(RULES_FILE), Charset.forName("UTF-8")))){
    List<String> lines = reader.lines().collect(Collectors.toList());
    addRules(repository,lines);
  } catch (IOException e) {
    LOGGER.error("Failed to load OCLint rules", e);
  }
  SqaleXmlLoader.load(repository, "/com/sonar/sqale/oclint-model.xml");
  repository.done();
}
origin: mrprince/sonar-p3c-pmd

 static void extractRulesData(NewRepository repository, String xmlRulesFilePath, String htmlDescriptionFolder) {
  RulesDefinitionXmlLoader ruleLoader = new RulesDefinitionXmlLoader();
  ruleLoader.load(repository, PmdRulesDefinition.class.getResourceAsStream(xmlRulesFilePath), "UTF-8");
  ExternalDescriptionLoader.loadHtmlDescriptions(repository, htmlDescriptionFolder);
  PropertyFileLoader.loadNames(repository, PmdRulesDefinition.class.getResourceAsStream("/org/sonar/l10n/pmd.properties"));
  SqaleXmlLoader.load(repository, "/com/sonar/sqale/pmd-model.xml");
 }
}
origin: checkstyle/sonar-checkstyle

@VisibleForTesting
static void extractRulesData(NewRepository repository, String xmlRulesFilePath,
    String htmlDescriptionFolder) throws IOException {
  final RulesDefinitionXmlLoader ruleLoader = new RulesDefinitionXmlLoader();
  try (InputStream resource = CheckstyleRulesDefinition.class
      .getResourceAsStream(xmlRulesFilePath)) {
    ruleLoader.load(repository, resource, "UTF-8");
  }
  ExternalDescriptionLoader.loadHtmlDescriptions(repository, htmlDescriptionFolder);
  try (InputStream resource = CheckstyleRulesDefinition.class
      .getResourceAsStream("/org/sonar/l10n/checkstyle.properties")) {
    loadNames(repository, resource);
  }
  SqaleXmlLoader.load(repository, "/com/sonar/sqale/checkstyle-model.xml");
}
origin: Backelite/sonar-swift

  @Override
  public void define(Context context) {
    NewRepository repository = context.createRepository(REPOSITORY_KEY, Swift.KEY).setName(REPOSITORY_NAME);

    try(Reader reader = new InputStreamReader(getClass().getResourceAsStream(RULES_FILE), Charset.forName("UTF-8"))){
      JSONArray slRules = (JSONArray)JSONValue.parse(reader);
      if(slRules != null){
        for (Object obj : slRules) {
          JSONObject slRule = (JSONObject) obj;
          repository.createRule((String) slRule.get("key"))
            .setName((String) slRule.get("name"))
            .setSeverity((String) slRule.get("severity"))
            .setHtmlDescription((String) slRule.get("description"));
        }
      }
    } catch (IOException e) {
      LOGGER.error("Failed to load SwiftLint rules", e);
    }
    SqaleXmlLoader.load(repository, "/com/sonar/sqale/swiftlint-model.xml");
    repository.done();
  }
}
origin: Backelite/sonar-swift

  @Override
  public void define(final Context context) {
    NewRepository repository = context.createRepository(REPOSITORY_KEY, Swift.KEY).setName(REPOSITORY_NAME);

    try(Reader reader = new InputStreamReader(getClass().getResourceAsStream(RULES_FILE), Charset.forName("UTF-8"))){
      JSONArray slRules = (JSONArray)JSONValue.parse(reader);
      if(slRules != null){
        for (Object obj : slRules) {
          JSONObject slRule = (JSONObject) obj;
          repository.createRule((String) slRule.get("key"))
            .setName((String) slRule.get("name"))
            .setSeverity((String) slRule.get("severity"))
            .setHtmlDescription(slRule.get("description") +
              " (<a href=" + slRule.get("styleguide") + ">" + slRule.get("styleguide") + "</a>)");
        }
      }
    } catch (IOException e) {
      LOGGER.error("Failed to load tailor rules", e);
    }
    SqaleXmlLoader.load(repository, "/com/sonar/sqale/tailor-model.xml");
    repository.done();
  }
}
origin: Backelite/sonar-swift

  @Override
  public void define(final Context context) {
    NewRepository repository = context.createRepository(REPOSITORY_KEY, ObjectiveC.KEY).setName(REPOSITORY_NAME);

    try(Reader reader = new InputStreamReader(getClass().getResourceAsStream(RULES_FILE), Charset.forName("UTF-8"))){
      JSONArray slRules = (JSONArray)JSONValue.parse(reader);
      if(slRules != null){
        for (Object obj : slRules) {
          JSONObject slRule = (JSONObject) obj;
          repository.createRule((String) slRule.get("key"))
            .setName((String) slRule.get("name"))
            .setSeverity((String) slRule.get("severity"))
            .setHtmlDescription((String) slRule.get("description"));
        }
      }
    } catch (IOException e) {
      LOGGER.error("Failed to load FauxPas rules", e);
    }
    SqaleXmlLoader.load(repository, "/com/sonar/sqale/fauxpas-model.xml");
    repository.done();
  }
}
origin: spotbugs/sonar-findbugs

 @Override
 public void define(Context context) {
  NewRepository repository = context
   .createRepository(REPOSITORY_KEY, Java.KEY)
   .setName(REPOSITORY_NAME);


  RulesDefinitionXmlLoader ruleLoaderJsp = new RulesDefinitionXmlLoader();
  ruleLoaderJsp.load(repository, FindSecurityBugsRulesDefinition.class.getResourceAsStream("/org/sonar/plugins/findbugs/rules-findbugs.xml"), "UTF-8");
  SqaleXmlLoader.load(repository, "/com/sonar/sqale/findbugs-model.xml");
  repository.done();

//    RulesDefinitionXmlLoader ruleLoader = new RulesDefinitionXmlLoader();
//    ruleLoader.load(repository, FindbugsRulesDefinition.class.getResourceAsStream("/org/sonar/plugins/findbugs/rules.xml"), "UTF-8");
//    ExternalDescriptionLoader.loadHtmlDescriptions(repository, "/org/sonar/l10n/findbugs/rules/findbugs");
//    SqaleXmlLoader.load(repository, "/com/sonar/sqale/findbugs-model.xml");
//    repository.done();
 }

origin: jensgerdes/sonar-pmd

static void extractRulesData(NewRepository repository, String xmlRulesFilePath, String htmlDescriptionFolder) {
  try (InputStream inputStream = PmdRulesDefinition.class.getResourceAsStream(xmlRulesFilePath)) {
    new RulesDefinitionXmlLoader()
        .load(
            repository,
            inputStream,
            StandardCharsets.UTF_8
        );
  } catch (IOException e) {
    LOGGER.error("Failed to load PMD RuleSet.", e);
  }
  ExternalDescriptionLoader.loadHtmlDescriptions(repository, htmlDescriptionFolder);
  loadNames(repository);
  SqaleXmlLoader.load(repository, "/com/sonar/sqale/pmd-model.xml");
}
origin: fabriciocolombo/sonar-delphi

@Override
public void define(Context context) {
 NewRepository repository = context
  .createRepository(DelphiPmdConstants.REPOSITORY_KEY, DelphiLanguage.KEY)
  .setName(DelphiPmdConstants.REPOSITORY_NAME);
 List<org.sonar.api.rules.Rule> rules = DelphiRulesUtils.getInitialReferential();
 // TODO Review
 // https://github.com/SonarCommunity/sonar-pmd/blob/master/src/main/java/org/sonar/plugins/pmd/PmdRulesDefinition.java
 for (org.sonar.api.rules.Rule rule : rules) {
  NewRule newRule = repository.createRule(rule.getKey())
   .setName(rule.getName())
   .setHtmlDescription(rule.getDescription())
   .setInternalKey(rule.getConfigKey())
   .setSeverity(rule.getSeverity().name());
  for (RuleParam param : rule.getParams()) {
   newRule.createParam(param.getKey())
    .setDefaultValue(param.getDefaultValue())
    .setType(RuleParamType.parse(param.getType()))
    .setDescription(param.getDescription());
  }
 }
 SqaleXmlLoader.load(repository, "/org/sonar/plugins/delphi/sqale/delphi-model.xml");
 repository.done();
}
org.sonar.squidbridge.rulesSqaleXmlLoaderload

Popular methods of SqaleXmlLoader

  • <init>
  • childrenMap
  • loadXmlResource
  • processRoot
  • processRule
  • processSubChar
  • reader
  • remediationFunction
  • timeValue

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now