test_class.file: dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParserTest.java
test_class.identifier: ConfigParserTest
test_case.body: @Test
      public void parseConfiguratorsServiceMultiAppsTest() throws IOException {
          try (InputStream yamlStream = this.getClass().getResourceAsStream("/ServiceMultiApps.yml")) {
              List<URL> urls = ConfigParser.parseConfigurators(streamToString(yamlStream));
              Assertions.assertNotNull(urls);
              Assertions.assertEquals(4, urls.size());
              URL url = urls.get(0);
              Assertions.assertEquals("127.0.0.1", url.getAddress());
              Assertions.assertEquals(6666, url.getParameter(TIMEOUT_KEY, 0));
              Assertions.assertNotNull(url.getParameter(APPLICATION_KEY));
          }
      }
test_case.class_method_signature: ConfigParserTest.parseConfiguratorsServiceMultiAppsTest()
test_case.full_signature: @Test public void parseConfiguratorsServiceMultiAppsTest()
test_case.identifier: parseConfiguratorsServiceMultiAppsTest
test_case.invocations: getResourceAsStream getClass parseConfigurators streamToString assertNotNull assertEquals size get assertEquals getAddress assertEquals getParameter assertNotNull getParameter
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parseConfiguratorsServiceMultiAppsTest()
focal_class.file: dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParser.java
focal_class.identifier: ConfigParser
focal_class.class_method_signature: ConfigParser.parseConfigurators(String rawConfig)
focal_class.full_signature: public static List<URL> parseConfigurators(String rawConfig)
focal_class.identifier: parseConfigurators
focal_class.modifiers: public static
focal_class.parameters: (String rawConfig)
focal_class.return: List<URL>
focal_class.signature: List<URL> parseConfigurators(String rawConfig)
focal_class.class_method_signature: ConfigParser.parseJsonArray(String rawConfig)
focal_class.full_signature: private static List<URL> parseJsonArray(String rawConfig)
focal_class.identifier: parseJsonArray
focal_class.modifiers: private static
focal_class.parameters: (String rawConfig)
focal_class.return: List<URL>
focal_class.signature: List<URL> parseJsonArray(String rawConfig)
focal_class.class_method_signature: ConfigParser.parseObject(String rawConfig)
focal_class.full_signature: private static T parseObject(String rawConfig)
focal_class.identifier: parseObject
focal_class.modifiers: private static
focal_class.parameters: (String rawConfig)
focal_class.return: T
focal_class.signature: T parseObject(String rawConfig)
focal_class.class_method_signature: ConfigParser.serviceItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.full_signature: private static List<URL> serviceItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.identifier: serviceItemToUrls
focal_class.modifiers: private static
focal_class.parameters: (ConfigItem item, ConfiguratorConfig config)
focal_class.return: List<URL>
focal_class.signature: List<URL> serviceItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.class_method_signature: ConfigParser.appItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.full_signature: private static List<URL> appItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.identifier: appItemToUrls
focal_class.modifiers: private static
focal_class.parameters: (ConfigItem item, ConfiguratorConfig config)
focal_class.return: List<URL>
focal_class.signature: List<URL> appItemToUrls(ConfigItem item, ConfiguratorConfig config)
focal_class.class_method_signature: ConfigParser.toParameterString(ConfigItem item)
focal_class.full_signature: private static String toParameterString(ConfigItem item)
focal_class.identifier: toParameterString
focal_class.modifiers: private static
focal_class.parameters: (ConfigItem item)
focal_class.return: String
focal_class.signature: String toParameterString(ConfigItem item)
focal_class.class_method_signature: ConfigParser.appendService(String serviceKey)
focal_class.full_signature: private static String appendService(String serviceKey)
focal_class.identifier: appendService
focal_class.modifiers: private static
focal_class.parameters: (String serviceKey)
focal_class.return: String
focal_class.signature: String appendService(String serviceKey)
focal_class.class_method_signature: ConfigParser.parseEnabled(ConfigItem item, ConfiguratorConfig config, StringBuilder urlBuilder)
focal_class.full_signature: private static void parseEnabled(ConfigItem item, ConfiguratorConfig config, StringBuilder urlBuilder)
focal_class.identifier: parseEnabled
focal_class.modifiers: private static
focal_class.parameters: (ConfigItem item, ConfiguratorConfig config, StringBuilder urlBuilder)
focal_class.return: void
focal_class.signature: void parseEnabled(ConfigItem item, ConfiguratorConfig config, StringBuilder urlBuilder)
focal_class.class_method_signature: ConfigParser.parseAddresses(ConfigItem item)
focal_class.full_signature: private static List<String> parseAddresses(ConfigItem item)
focal_class.identifier: parseAddresses
focal_class.modifiers: private static
focal_class.parameters: (ConfigItem item)
focal_class.return: List<String>
focal_class.signature: List<String> parseAddresses(ConfigItem item)
focal_class.class_method_signature: ConfigParser.isJsonArray(String rawConfig)
focal_class.full_signature: private static boolean isJsonArray(String rawConfig)
focal_class.identifier: isJsonArray
focal_class.modifiers: private static
focal_class.parameters: (String rawConfig)
focal_class.return: boolean
focal_class.signature: boolean isJsonArray(String rawConfig)
focal_method.body: public static List<URL> parseConfigurators(String rawConfig) {
          // compatible url JsonArray, such as [ "override://xxx", "override://xxx" ]
          if (isJsonArray(rawConfig)) {
              return parseJsonArray(rawConfig);
          }
  
          List<URL> urls = new ArrayList<>();
          ConfiguratorConfig configuratorConfig = parseObject(rawConfig);
  
          String scope = configuratorConfig.getScope();
          List<ConfigItem> items = configuratorConfig.getConfigs();
  
          if (ConfiguratorConfig.SCOPE_APPLICATION.equals(scope)) {
              items.forEach(item -> urls.addAll(appItemToUrls(item, configuratorConfig)));
          } else {
              // service scope by default.
              items.forEach(item -> urls.addAll(serviceItemToUrls(item, configuratorConfig)));
          }
          return urls;
      }
focal_method.class_method_signature: ConfigParser.parseConfigurators(String rawConfig)
focal_method.full_signature: public static List<URL> parseConfigurators(String rawConfig)
focal_method.identifier: parseConfigurators
focal_method.invocations: isJsonArray parseJsonArray parseObject getScope getConfigs equals forEach addAll appItemToUrls forEach addAll serviceItemToUrls
focal_method.modifiers: public static
focal_method.parameters: (String rawConfig)
focal_method.return: List<URL>
focal_method.signature: List<URL> parseConfigurators(String rawConfig)