test_class.declarator: INPUT_FILE = new File("src/test/resource/resfilter/json/input.json")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT_FILE = new File("src/test/resource/resfilter/json/input.json");
test_class.type: File
test_class.var_name: INPUT_FILE
test_class.declarator: OUTPUT_FILE = new File("src/test/resource/resfilter/json/output.json")
test_class.modifier: private static final
test_class.original_string: private static final File OUTPUT_FILE = new File("src/test/resource/resfilter/json/output.json");
test_class.type: File
test_class.var_name: OUTPUT_FILE
test_class.declarator: INPUT_FILE2 = new File("src/test/resource/resfilter/json/other-input.json")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT_FILE2 = new File("src/test/resource/resfilter/json/other-input.json");
test_class.type: File
test_class.var_name: INPUT_FILE2
test_class.declarator: SPLITKEYS = new File("src/test/resource/resfilter/json/testSplitKeys.json")
test_class.modifier: private static final
test_class.original_string: private static final File SPLITKEYS = new File("src/test/resource/resfilter/json/testSplitKeys.json");
test_class.type: File
test_class.var_name: SPLITKEYS
test_class.declarator: EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/json/write-output.json")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/json/write-output.json");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE
test_class.declarator: EXPECTED_INPUT_RES_LIST
test_class.modifier: private static final
test_class.original_string: private static final Collection<ResourceString> EXPECTED_INPUT_RES_LIST;
test_class.type: Collection<ResourceString>
test_class.var_name: EXPECTED_INPUT_RES_LIST
test_class.declarator: WRITE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle WRITE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: WRITE_BUNDLE
test_class.declarator: res = new JsonResource()
test_class.modifier: private static final
test_class.original_string: private static final JsonResource res = new JsonResource();
test_class.type: JsonResource
test_class.var_name: res
test_class.file: gp-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/impl/JsonResourceTest.java
test_class.identifier: JsonResourceTest
test_case.body: @Test
      public void testParse() throws IOException, ResourceFilterException {
          assertTrue("The input test file <" + INPUT_FILE + "> does not exist.", INPUT_FILE.exists());
  
          try (InputStream is = new FileInputStream(INPUT_FILE)) {
              LanguageBundle bundle = res.parse(is, null);
              List<ResourceString> resStrList = new ArrayList<>(bundle.getResourceStrings());
              Collections.sort(resStrList, new ResourceStringComparator());
              assertArrayEquals("ResourceStrings did not match.", EXPECTED_INPUT_RES_LIST.toArray(),
                      resStrList.toArray());
          }
      }
test_case.class_method_signature: JsonResourceTest.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: assertTrue exists parse getResourceStrings sort assertArrayEquals toArray toArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.declarator: JSONPATH_ROOT = "$"
focal_class.modifier: private static final
focal_class.original_string: private static final String JSONPATH_ROOT = "$";
focal_class.type: String
focal_class.var_name: JSONPATH_ROOT
focal_class.declarator: USE_JSONPATH_PATTERN = Pattern.compile("^\\$[.\\[].*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern USE_JSONPATH_PATTERN = Pattern.compile("^\\$[.\\[].*");
focal_class.type: Pattern
focal_class.var_name: USE_JSONPATH_PATTERN
focal_class.declarator: USE_BRACKET_PATTERN = Pattern.compile("[.'\\[\\]]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern USE_BRACKET_PATTERN = Pattern.compile("[.'\\[\\]]");
focal_class.type: Pattern
focal_class.var_name: USE_BRACKET_PATTERN
focal_class.file: gp-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/impl/JsonResource.java
focal_class.identifier: JsonResource
focal_class.class_method_signature: JsonResource.parse(InputStream inStream, FilterOptions options)
focal_class.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream inStream, FilterOptions options)
focal_class.return: LanguageBundle
focal_class.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.class_method_signature: JsonResource.addBundleStrings(JsonObject obj, String keyPrefix, LanguageBundleBuilder bb, int sequenceNum)
focal_class.full_signature: protected int addBundleStrings(JsonObject obj, String keyPrefix, LanguageBundleBuilder bb, int sequenceNum)
focal_class.identifier: addBundleStrings
focal_class.modifiers: protected
focal_class.parameters: (JsonObject obj, String keyPrefix, LanguageBundleBuilder bb, int sequenceNum)
focal_class.return: int
focal_class.signature: int addBundleStrings(JsonObject obj, String keyPrefix, LanguageBundleBuilder bb, int sequenceNum)
focal_class.class_method_signature: JsonResource.encodeResourceKey(String parent, String key, boolean isLeaf)
focal_class.full_signature: protected String encodeResourceKey(String parent, String key, boolean isLeaf)
focal_class.identifier: encodeResourceKey
focal_class.modifiers: protected
focal_class.parameters: (String parent, String key, boolean isLeaf)
focal_class.return: String
focal_class.signature: String encodeResourceKey(String parent, String key, boolean isLeaf)
focal_class.class_method_signature: JsonResource.write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.full_signature: @Override public void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.return: void
focal_class.signature: void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.class_method_signature: JsonResource.splitKeyPieces(String key)
focal_class.full_signature: static List<KeyPiece> splitKeyPieces(String key)
focal_class.identifier: splitKeyPieces
focal_class.modifiers: static
focal_class.parameters: (String key)
focal_class.return: List<KeyPiece>
focal_class.signature: List<KeyPiece> splitKeyPieces(String key)
focal_class.class_method_signature: JsonResource.addToken(List<KeyPiece> result, String s, boolean inSubscript)
focal_class.full_signature: static void addToken(List<KeyPiece> result, String s, boolean inSubscript)
focal_class.identifier: addToken
focal_class.modifiers: static
focal_class.parameters: (List<KeyPiece> result, String s, boolean inSubscript)
focal_class.return: void
focal_class.signature: void addToken(List<KeyPiece> result, String s, boolean inSubscript)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public LanguageBundle parse(InputStream inStream, FilterOptions options)
              throws IOException, ResourceFilterException {
          LanguageBundleBuilder bb = new LanguageBundleBuilder(false);    // TODO: Can we use auto sequence# mode?
          try (InputStreamReader reader = new InputStreamReader(new BomInputStream(inStream), StandardCharsets.UTF_8)) {
              JsonElement root = new JsonParser().parse(reader);
              if (!root.isJsonObject()) {
                  throw new IllegalResourceFormatException("The root JSON element is not an JSON object.");
              }
              addBundleStrings(root.getAsJsonObject(), "", bb, 0);
          } catch (JsonParseException e) {
              throw new IllegalResourceFormatException("Failed to parse the specified JSON contents.", e);
          }
          return bb.build();
      }
focal_method.class_method_signature: JsonResource.parse(InputStream inStream, FilterOptions options)
focal_method.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_method.identifier: parse
focal_method.invocations: parse isJsonObject addBundleStrings getAsJsonObject build
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream inStream, FilterOptions options)
focal_method.return: LanguageBundle
focal_method.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)