public RuleConfigParser obtainRuleConfigParser(RuleConfigParser ruleConfigParser) {
    /* create according to SPI */
    if (ruleConfigParser == null) {
      ruleConfigParser = ExtensionLoader.getExtension(RuleConfigParser.class, false);
    }

    /* create according to configuration */
    if (ruleConfigParser == null) {
      String parserType = RateLimiterConfig.instance().getRuleConfigParserType();
      // TODO(zheng): ugly code, refactor it!
      if (parserType.equals("yaml")) {
        ruleConfigParser = new YamlRuleConfigParser();
      } else if (parserType.equals("json")) {
        ruleConfigParser = new JsonRuleConfigParser();
      }
    }

    /* use default rule config source. */
    if (ruleConfigParser == null) {
      ruleConfigParser = new YamlRuleConfigParser();
    }

    return ruleConfigParser;
  }
Obtain {@link RuleConfigParser}.

@param ruleConfigSource the rule config source which can be null.
@return the input parameter {@code ruleConfigSource} if not null, otherwise return a new
        {@link RuleConfigSource}.
src/main/java/com/eudemon/ratelimiter/context/RateLimiterBeansFactory.java