test_class.declarator: transformer
test_class.modifier: private
test_class.original_string: private UriTransformer transformer;
test_class.type: UriTransformer
test_class.var_name: transformer
test_class.declarator: veryLongUriString
test_class.modifier: private
test_class.original_string: private StringBuilder veryLongUriString;
test_class.type: StringBuilder
test_class.var_name: veryLongUriString
test_class.file: commons/ihe/xds/src/test/java/org/openehealth/ipf/commons/ihe/xds/core/transform/ebxml/UriTransformerTest.java
test_class.identifier: UriTransformerTest
test_case.body: @Test
      public void testToEbXMLWithShortestUriUsingTwoSlots() {
          String uri = veryLongUriString.substring(0, 127);
          String[] ebXML = transformer.toEbXML(uri);
          String uriPart1 = uri.substring(0, 126);
          String uriPart2 = uri.substring(126, 127);
          assertEquals(2, ebXML.length);
          assertEquals("1|" + uriPart1, ebXML[0]);
          assertEquals("2|" + uriPart2, ebXML[1]);
      }
test_case.class_method_signature: UriTransformerTest.testToEbXMLWithShortestUriUsingTwoSlots()
test_case.full_signature: @Test public void testToEbXMLWithShortestUriUsingTwoSlots()
test_case.identifier: testToEbXMLWithShortestUriUsingTwoSlots
test_case.invocations: substring toEbXML substring substring assertEquals assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testToEbXMLWithShortestUriUsingTwoSlots()
focal_class.file: commons/ihe/xds/src/main/java/org/openehealth/ipf/commons/ihe/xds/core/transform/ebxml/UriTransformer.java
focal_class.identifier: UriTransformer
focal_class.class_method_signature: UriTransformer.fromEbXML(List<String> slotValues)
focal_class.full_signature: public String fromEbXML(List<String> slotValues)
focal_class.identifier: fromEbXML
focal_class.modifiers: public
focal_class.parameters: (List<String> slotValues)
focal_class.return: String
focal_class.signature: String fromEbXML(List<String> slotValues)
focal_class.class_method_signature: UriTransformer.toEbXML(String uri)
focal_class.full_signature: public String[] toEbXML(String uri)
focal_class.identifier: toEbXML
focal_class.modifiers: public
focal_class.parameters: (String uri)
focal_class.return: String[]
focal_class.signature: String[] toEbXML(String uri)
focal_method.body: public String[] toEbXML(String uri) {
          if (uri == null) {
              return new String[0];
          }
          
          List<String> uriParts = new ArrayList<String>();
          
          int slotIdx = 1;
          int start = 0;
          while (start < uri.length()) {
              String prefix = slotIdx + "|";
              int validLength = 128 - prefix.length();
              if (uri.length() < start + validLength) {
                  validLength = uri.length() - start;
              }
              
              String uriPart = uri.substring(start, start + validLength);
              String slotValue = prefix + uriPart;
              uriParts.add(slotValue);
              
              start += validLength;
              ++slotIdx;
          }
          
          return uriParts.toArray(new String[uriParts.size()]);
      }
focal_method.class_method_signature: UriTransformer.toEbXML(String uri)
focal_method.full_signature: public String[] toEbXML(String uri)
focal_method.identifier: toEbXML
focal_method.invocations: length length length length substring add toArray size
focal_method.modifiers: public
focal_method.parameters: (String uri)
focal_method.return: String[]
focal_method.signature: String[] toEbXML(String uri)