test_class.declarator: INPUT_FILE = new File("src/test/resource/resfilter/xliff/input.xlf")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT_FILE = new File("src/test/resource/resfilter/xliff/input.xlf");
test_class.type: File
test_class.var_name: INPUT_FILE
test_class.declarator: EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/xliff/write-output.xlf")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/xliff/write-output.xlf");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE
test_class.declarator: MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/xliff/merge-input-1.xlf")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/xliff/merge-input-1.xlf");
test_class.type: File
test_class.var_name: MERGE_INPUT_1_FILE
test_class.declarator: MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/xliff/merge-input-2.xlf")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/xliff/merge-input-2.xlf");
test_class.type: File
test_class.var_name: MERGE_INPUT_2_FILE
test_class.declarator: EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/xliff/merge-output-1.xlf")
test_class.modifier: @SuppressWarnings("unused")
      private static final
test_class.original_string: @SuppressWarnings("unused")
      private static final File EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/xliff/merge-output-1.xlf");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_1_FILE
test_class.declarator: EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/xliff/merge-output-2.xlf")
test_class.modifier: @SuppressWarnings("unused")
      private static final
test_class.original_string: @SuppressWarnings("unused")
      private static final File EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/xliff/merge-output-2.xlf");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_2_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: MERGE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle MERGE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: MERGE_BUNDLE
test_class.declarator: res = new XLIFFResource()
test_class.modifier: private static final
test_class.original_string: private static final XLIFFResource res = new XLIFFResource();
test_class.type: XLIFFResource
test_class.var_name: res
test_class.file: gp-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/impl/XLIFFResourceTest.java
test_class.identifier: XLIFFResourceTest
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());
              assertEquals("ResourceStrings did not match.", EXPECTED_INPUT_RES_LIST, resStrList);
          }
      }
test_case.class_method_signature: XLIFFResourceTest.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: assertTrue exists parse getResourceStrings sort assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.declarator: VERSION_STRING = "version"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION_STRING = "version";
focal_class.type: String
focal_class.var_name: VERSION_STRING
focal_class.declarator: VERSION_NUMBER_STRING = "1.2"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION_NUMBER_STRING = "1.2";
focal_class.type: String
focal_class.var_name: VERSION_NUMBER_STRING
focal_class.declarator: XMLNS_STRING = "xmlns:xsi"
focal_class.modifier: private static final
focal_class.original_string: private static final String XMLNS_STRING = "xmlns:xsi";
focal_class.type: String
focal_class.var_name: XMLNS_STRING
focal_class.declarator: XMLNS_VALUE_STRING = "http://www.w3.org/2001/XMLSchema-instance"
focal_class.modifier: private static final
focal_class.original_string: private static final String XMLNS_VALUE_STRING = "http://www.w3.org/2001/XMLSchema-instance";
focal_class.type: String
focal_class.var_name: XMLNS_VALUE_STRING
focal_class.declarator: XSI_STRING = "xsi:schemaLocation"
focal_class.modifier: private static final
focal_class.original_string: private static final String XSI_STRING = "xsi:schemaLocation";
focal_class.type: String
focal_class.var_name: XSI_STRING
focal_class.declarator: XSI_VALUE_STRING = "urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-strict.xsd"
focal_class.modifier: private static final
focal_class.original_string: private static final String XSI_VALUE_STRING = "urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-strict.xsd";
focal_class.type: String
focal_class.var_name: XSI_VALUE_STRING
focal_class.declarator: UNIT_STRING = "trans-unit"
focal_class.modifier: private static final
focal_class.original_string: private static final String UNIT_STRING = "trans-unit";
focal_class.type: String
focal_class.var_name: UNIT_STRING
focal_class.declarator: ID_STRING = "id"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID_STRING = "id";
focal_class.type: String
focal_class.var_name: ID_STRING
focal_class.declarator: SOURCE_STRING = "source"
focal_class.modifier: private static final
focal_class.original_string: private static final String SOURCE_STRING = "source";
focal_class.type: String
focal_class.var_name: SOURCE_STRING
focal_class.declarator: TARGET_STRING = "target"
focal_class.modifier: private static final
focal_class.original_string: private static final String TARGET_STRING = "target";
focal_class.type: String
focal_class.var_name: TARGET_STRING
focal_class.declarator: XLIFF_STRING = "xliff"
focal_class.modifier: private static final
focal_class.original_string: private static final String XLIFF_STRING = "xliff";
focal_class.type: String
focal_class.var_name: XLIFF_STRING
focal_class.declarator: FILE_STRING = "file"
focal_class.modifier: private static final
focal_class.original_string: private static final String FILE_STRING = "file";
focal_class.type: String
focal_class.var_name: FILE_STRING
focal_class.declarator: ORIGINAL_STRING = "original"
focal_class.modifier: private static final
focal_class.original_string: private static final String ORIGINAL_STRING = "original";
focal_class.type: String
focal_class.var_name: ORIGINAL_STRING
focal_class.declarator: GLOBAL_STRING = "g11n-pipeline"
focal_class.modifier: private static final
focal_class.original_string: private static final String GLOBAL_STRING = "g11n-pipeline";
focal_class.type: String
focal_class.var_name: GLOBAL_STRING
focal_class.declarator: DATATYPE_STRING = "datatype"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATATYPE_STRING = "datatype";
focal_class.type: String
focal_class.var_name: DATATYPE_STRING
focal_class.declarator: PLAINTEXT_STRING = "plaintext"
focal_class.modifier: private static final
focal_class.original_string: private static final String PLAINTEXT_STRING = "plaintext";
focal_class.type: String
focal_class.var_name: PLAINTEXT_STRING
focal_class.declarator: SOURCE_LANGUAGE_STRING = "source-language"
focal_class.modifier: private static final
focal_class.original_string: private static final String SOURCE_LANGUAGE_STRING = "source-language";
focal_class.type: String
focal_class.var_name: SOURCE_LANGUAGE_STRING
focal_class.declarator: ENGLISH = "en"
focal_class.modifier: private static final
focal_class.original_string: private static final String ENGLISH = "en";
focal_class.type: String
focal_class.var_name: ENGLISH
focal_class.declarator: TARGET_LANGUAGE_STRING = "target-language"
focal_class.modifier: private static final
focal_class.original_string: private static final String TARGET_LANGUAGE_STRING = "target-language";
focal_class.type: String
focal_class.var_name: TARGET_LANGUAGE_STRING
focal_class.declarator: BODY_STRING = "body"
focal_class.modifier: private static final
focal_class.original_string: private static final String BODY_STRING = "body";
focal_class.type: String
focal_class.var_name: BODY_STRING
focal_class.file: gp-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/impl/XLIFFResource.java
focal_class.identifier: XLIFFResource
focal_class.class_method_signature: XLIFFResource.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: XLIFFResource.collectResourceStrings(NodeList nodeList, LanguageBundleBuilder bb, int version, String key)
focal_class.full_signature: private void collectResourceStrings(NodeList nodeList, LanguageBundleBuilder bb, int version, String key)
focal_class.identifier: collectResourceStrings
focal_class.modifiers: private
focal_class.parameters: (NodeList nodeList, LanguageBundleBuilder bb, int version, String key)
focal_class.return: void
focal_class.signature: void collectResourceStrings(NodeList nodeList, LanguageBundleBuilder bb, int version, String key)
focal_class.class_method_signature: XLIFFResource.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: XLIFFResource.merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.full_signature: @Override @Deprecated /* * This method is incomplete and may not produce the expected output. * * (non-Javadoc) * @see com.ibm.g11n.pipeline.resfilter.ResourceFilter#merge(java.io.InputStream, java.io.OutputStream, java.lang.String, java.util.Collection) */ public void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.identifier: merge
focal_class.modifiers: @Override @Deprecated /* * This method is incomplete and may not produce the expected output. * * (non-Javadoc) * @see com.ibm.g11n.pipeline.resfilter.ResourceFilter#merge(java.io.InputStream, java.io.OutputStream, java.lang.String, java.util.Collection) */ public
focal_class.parameters: (InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.return: void
focal_class.signature: void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public LanguageBundle parse(InputStream inStream, FilterOptions options)
              throws IOException, ResourceFilterException {
  
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = null;
          try {
              builder = factory.newDocumentBuilder();
          } catch (ParserConfigurationException e) {
              // runtime problem
              throw new RuntimeException(e);
          }
  
          Document document = null;
          try {
              document = builder.parse(inStream);
          } catch (SAXException e) {
              throw new IllegalResourceFormatException(e);
          }
  
          Element elem = document.getDocumentElement();
          NodeList nodeList = elem.getChildNodes();
  
          int version = (int) Float.parseFloat(elem.getAttribute(VERSION_STRING));
  
          LanguageBundleBuilder bb = new LanguageBundleBuilder(true);
          collectResourceStrings(nodeList, bb, version, "");
          return bb.build();
      }
focal_method.class_method_signature: XLIFFResource.parse(InputStream inStream, FilterOptions options)
focal_method.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_method.identifier: parse
focal_method.invocations: newInstance newDocumentBuilder parse getDocumentElement getChildNodes parseFloat getAttribute collectResourceStrings 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)