This is an automated email from the ASF dual-hosted git repository.
cbrisson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/velocity-tools.git
The following commit(s) were added to refs/heads/master by this push:
new 7c182b1 [tools] Address VELTOOLS-194: Deprecate getPath() in favor of
getNodePath() for homogeneity with getName()/getNodeName()
7c182b1 is described below
commit 7c182b10695958da5b6da3dad35fd75b6405e21c
Author: Claude Brisson <[email protected]>
AuthorDate: Wed Dec 1 20:53:07 2021 +0100
[tools] Address VELTOOLS-194: Deprecate getPath() in favor of getNodePath()
for homogeneity with getName()/getNodeName()
---
.../org/apache/velocity/tools/generic/XmlTool.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git
a/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/XmlTool.java
b/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/XmlTool.java
index 8a07fc3..ec7b613 100644
---
a/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/XmlTool.java
+++
b/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/XmlTool.java
@@ -357,11 +357,26 @@ public class XmlTool extends SafeConfig implements
Serializable
}
/**
+ * <p>Returns the XPath that identifies the first/sole {@link Node}
+ * represented by this instance.</p>
+ * <p>This function is deprecated. In future versions, this function will
first try
+ * <code>get("path")</code> before resorting to
<code>getNodePath()</code>.</p>
+ * @return xpath node path
+ * @deprecated use getNodePath()
+ */
+ @Deprecated
+ public String getPath()
+ {
+ return getNodePath();
+ }
+
+ /**
* Returns the XPath that identifies the first/sole {@link Node}
* represented by this instance.
+ * @since 3.2
* @return xpath node path
*/
- public String getPath()
+ public String getNodePath()
{
if (isEmpty())
{
@@ -369,7 +384,7 @@ public class XmlTool extends SafeConfig implements
Serializable
}
return XmlUtils.nodePath(node());
}
-
+
/**
* Returns the value of the specified attribute for the first/sole
* {@link Node} in the internal Node list for this instance, if that