test_class.declarator: xpFact = new XPathWrapperFactory()
                                           .bindNamespace("mvn", "http://maven.apache.org/POM/4.0.0")
test_class.modifier: private
test_class.original_string: private XPathWrapperFactory xpFact = new XPathWrapperFactory()
                                           .bindNamespace("mvn", "http://maven.apache.org/POM/4.0.0");
test_class.type: XPathWrapperFactory
test_class.var_name: xpFact
test_class.file: lib-common/src/test/java/com/kdgregory/pomutil/util/TestPomWrapper.java
test_class.identifier: TestPomWrapper
test_case.body: @Test
      public void testResolveProjectProperties() throws Exception
      {
          PomWrapper wrapper = new PomWrapper(ParseUtil.parseFromClasspath("PomWrapper3.xml"));
  
          assertEquals("project.groupId",         "com.example.pom",  wrapper.resolveProperties("${project.groupId}"));
          assertEquals("project.artifactId",      "wrapper3",         wrapper.resolveProperties("${project.artifactId}"));
          assertEquals("project.version",         "0.0.0-SNAPSHOT",   wrapper.resolveProperties("${project.version}"));
      }
test_case.class_method_signature: TestPomWrapper.testResolveProjectProperties()
test_case.full_signature: @Test public void testResolveProjectProperties()
test_case.identifier: testResolveProjectProperties
test_case.invocations: parseFromClasspath assertEquals resolveProperties assertEquals resolveProperties assertEquals resolveProperties
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testResolveProjectProperties()
focal_class.declarator: dom
focal_class.modifier: private
focal_class.original_string: private Document dom;
focal_class.type: Document
focal_class.var_name: dom
focal_class.declarator: xpFact = new XPathWrapperFactory(CacheType.SIMPLE)
                                           .bindNamespace("mvn", "http://maven.apache.org/POM/4.0.0")
focal_class.modifier: private
focal_class.original_string: private XPathWrapperFactory xpFact = new XPathWrapperFactory(CacheType.SIMPLE)
                                           .bindNamespace("mvn", "http://maven.apache.org/POM/4.0.0");
focal_class.type: XPathWrapperFactory
focal_class.var_name: xpFact
focal_class.declarator: pomWithoutNamespace
focal_class.modifier: private
focal_class.original_string: private boolean pomWithoutNamespace;
focal_class.type: boolean
focal_class.var_name: pomWithoutNamespace
focal_class.declarator: groupId
focal_class.modifier: private
focal_class.original_string: private String groupId;
focal_class.type: String
focal_class.var_name: groupId
focal_class.declarator: artifactId
focal_class.modifier: private
focal_class.original_string: private String artifactId;
focal_class.type: String
focal_class.var_name: artifactId
focal_class.declarator: version
focal_class.modifier: private
focal_class.original_string: private String version;
focal_class.type: String
focal_class.var_name: version
focal_class.declarator: packaging
focal_class.modifier: private
focal_class.original_string: private String packaging;
focal_class.type: String
focal_class.var_name: packaging
focal_class.file: lib-common/src/main/java/com/kdgregory/pomutil/util/PomWrapper.java
focal_class.identifier: PomWrapper
focal_class.class_method_signature: PomWrapper.PomWrapper(Document dom)
focal_class.full_signature: public  PomWrapper(Document dom)
focal_class.identifier: PomWrapper
focal_class.modifiers: public
focal_class.parameters: (Document dom)
focal_class.signature:  PomWrapper(Document dom)
focal_class.class_method_signature: PomWrapper.PomWrapper(File file)
focal_class.full_signature: public  PomWrapper(File file)
focal_class.identifier: PomWrapper
focal_class.modifiers: public
focal_class.parameters: (File file)
focal_class.signature:  PomWrapper(File file)
focal_class.class_method_signature: PomWrapper.getDom()
focal_class.full_signature: public Document getDom()
focal_class.identifier: getDom
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Document
focal_class.signature: Document getDom()
focal_class.class_method_signature: PomWrapper.setDom(Document dom)
focal_class.full_signature: public void setDom(Document dom)
focal_class.identifier: setDom
focal_class.modifiers: public
focal_class.parameters: (Document dom)
focal_class.return: void
focal_class.signature: void setDom(Document dom)
focal_class.class_method_signature: PomWrapper.selectValue(String xpath)
focal_class.full_signature: public String selectValue(String xpath)
focal_class.identifier: selectValue
focal_class.modifiers: public
focal_class.parameters: (String xpath)
focal_class.return: String
focal_class.signature: String selectValue(String xpath)
focal_class.class_method_signature: PomWrapper.selectValue(Node node, String xpath)
focal_class.full_signature: public String selectValue(Node node, String xpath)
focal_class.identifier: selectValue
focal_class.modifiers: public
focal_class.parameters: (Node node, String xpath)
focal_class.return: String
focal_class.signature: String selectValue(Node node, String xpath)
focal_class.class_method_signature: PomWrapper.selectElement(String xpath)
focal_class.full_signature: public Element selectElement(String xpath)
focal_class.identifier: selectElement
focal_class.modifiers: public
focal_class.parameters: (String xpath)
focal_class.return: Element
focal_class.signature: Element selectElement(String xpath)
focal_class.class_method_signature: PomWrapper.selectElement(Node node, String xpath)
focal_class.full_signature: public Element selectElement(Node node, String xpath)
focal_class.identifier: selectElement
focal_class.modifiers: public
focal_class.parameters: (Node node, String xpath)
focal_class.return: Element
focal_class.signature: Element selectElement(Node node, String xpath)
focal_class.class_method_signature: PomWrapper.selectElements(String... paths)
focal_class.full_signature: public List<Element> selectElements(String... paths)
focal_class.identifier: selectElements
focal_class.modifiers: public
focal_class.parameters: (String... paths)
focal_class.return: List<Element>
focal_class.signature: List<Element> selectElements(String... paths)
focal_class.class_method_signature: PomWrapper.selectElements(Node node, String... paths)
focal_class.full_signature: public List<Element> selectElements(Node node, String... paths)
focal_class.identifier: selectElements
focal_class.modifiers: public
focal_class.parameters: (Node node, String... paths)
focal_class.return: List<Element>
focal_class.signature: List<Element> selectElements(Node node, String... paths)
focal_class.class_method_signature: PomWrapper.selectOrCreateElement(String xpath)
focal_class.full_signature: public Element selectOrCreateElement(String xpath)
focal_class.identifier: selectOrCreateElement
focal_class.modifiers: public
focal_class.parameters: (String xpath)
focal_class.return: Element
focal_class.signature: Element selectOrCreateElement(String xpath)
focal_class.class_method_signature: PomWrapper.clear(String xpath)
focal_class.full_signature: public Element clear(String xpath)
focal_class.identifier: clear
focal_class.modifiers: public
focal_class.parameters: (String xpath)
focal_class.return: Element
focal_class.signature: Element clear(String xpath)
focal_class.class_method_signature: PomWrapper.getProperties()
focal_class.full_signature: public Map<String,String> getProperties()
focal_class.identifier: getProperties
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String,String>
focal_class.signature: Map<String,String> getProperties()
focal_class.class_method_signature: PomWrapper.getProperty(String name)
focal_class.full_signature: public String getProperty(String name)
focal_class.identifier: getProperty
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: String
focal_class.signature: String getProperty(String name)
focal_class.class_method_signature: PomWrapper.setProperty(String name, String value)
focal_class.full_signature: public void setProperty(String name, String value)
focal_class.identifier: setProperty
focal_class.modifiers: public
focal_class.parameters: (String name, String value)
focal_class.return: void
focal_class.signature: void setProperty(String name, String value)
focal_class.class_method_signature: PomWrapper.deleteProperty(String name)
focal_class.full_signature: public void deleteProperty(String name)
focal_class.identifier: deleteProperty
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void deleteProperty(String name)
focal_class.class_method_signature: PomWrapper.resolveProperties(String src)
focal_class.full_signature: public String resolveProperties(String src)
focal_class.identifier: resolveProperties
focal_class.modifiers: public
focal_class.parameters: (String src)
focal_class.return: String
focal_class.signature: String resolveProperties(String src)
focal_class.class_method_signature: PomWrapper.getGAV()
focal_class.full_signature: public Artifact getGAV()
focal_class.identifier: getGAV
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Artifact
focal_class.signature: Artifact getGAV()
focal_class.class_method_signature: PomWrapper.getParent()
focal_class.full_signature: public Artifact getParent()
focal_class.identifier: getParent
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Artifact
focal_class.signature: Artifact getParent()
focal_class.class_method_signature: PomWrapper.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: PomWrapper.filterByGroupAndArtifact(List<Element> elements, String withGroupId, String withArtifactId)
focal_class.full_signature: public List<Element> filterByGroupAndArtifact(List<Element> elements, String withGroupId, String withArtifactId)
focal_class.identifier: filterByGroupAndArtifact
focal_class.modifiers: public
focal_class.parameters: (List<Element> elements, String withGroupId, String withArtifactId)
focal_class.return: List<Element>
focal_class.signature: List<Element> filterByGroupAndArtifact(List<Element> elements, String withGroupId, String withArtifactId)
focal_class.class_method_signature: PomWrapper.mungePath(String xpath)
focal_class.full_signature: private String mungePath(String xpath)
focal_class.identifier: mungePath
focal_class.modifiers: private
focal_class.parameters: (String xpath)
focal_class.return: String
focal_class.signature: String mungePath(String xpath)
focal_class.class_method_signature: PomWrapper.lookupPropertyValue(String propName)
focal_class.full_signature: private String lookupPropertyValue(String propName)
focal_class.identifier: lookupPropertyValue
focal_class.modifiers: private
focal_class.parameters: (String propName)
focal_class.return: String
focal_class.signature: String lookupPropertyValue(String propName)
focal_class.class_method_signature: PomWrapper.pathToProp(String propName)
focal_class.full_signature: private static String pathToProp(String propName)
focal_class.identifier: pathToProp
focal_class.modifiers: private static
focal_class.parameters: (String propName)
focal_class.return: String
focal_class.signature: String pathToProp(String propName)
focal_method.body: public String resolveProperties(String src)
      {
          if (src == null)
              return "";
  
          StringBuilder dst = new StringBuilder(256).append(src);
  
          int propIdx = 0;
          while ((propIdx = dst.indexOf("${", propIdx)) >= 0)
          {
              int endPropIdx = dst.indexOf("}", propIdx);
              if (endPropIdx < 0)
                  break;  // unterminated propname
              String propName = dst.substring(propIdx+2, endPropIdx);
              if (propName.contains("{"))
                  break;  // unterminated propname that causes problems with XPath
              String propValue = lookupPropertyValue(propName);
              if (! StringUtil.isBlank(propValue))
              {
                  dst.delete(propIdx, endPropIdx + 1);
                  if (propIdx < dst.length())
                      dst.insert(propIdx, propValue);
                  else
                      dst.append(propValue);
              }
              else
              {
                  // leave the unresolved property in place
                  propIdx = endPropIdx;
              }
          }
  
          return dst.toString();
      }
focal_method.class_method_signature: PomWrapper.resolveProperties(String src)
focal_method.full_signature: public String resolveProperties(String src)
focal_method.identifier: resolveProperties
focal_method.invocations: append indexOf indexOf substring contains lookupPropertyValue isBlank delete length insert append toString
focal_method.modifiers: public
focal_method.parameters: (String src)
focal_method.return: String
focal_method.signature: String resolveProperties(String src)