Skip to content

Commit

Permalink
Add generics to JXPathContext.iterate(String)
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Nov 16, 2024
1 parent d3f1012 commit 6e993b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ The <action> type attribute can be add,update,fix,remove.
[StepSecurity] ci: Harden GitHub Actions #66.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.iterate(String).</action>
<!-- ADD -->
<action issue="JXPATH-123" dev="mbenson" type="add">
XPath function "ends-with" is not implemented (although "starts-with" is).
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/apache/commons/jxpath/JXPathContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,12 @@ public List selectNodes(final String xpath) {
* Traverses the xpath and returns an Iterator of all results found
* for the path. If the xpath matches no properties
* in the graph, the Iterator will be empty, but not null.
*
* @param <E> the type of elements returned by the iterator.
* @param xpath to iterate
* @return Iterator
*/
public abstract Iterator iterate(String xpath);
public abstract <E> Iterator<E> iterate(String xpath);

/**
* Traverses the xpath and returns a Pointer. A Pointer provides easy access
Expand Down

0 comments on commit 6e993b3

Please sign in to comment.