[YANGTOOLS-711] XPath: provide an evaluator on top of DataTreeCandidate Created: 04/Nov/16 Updated: 18/Jan/24 |
|
| Status: | Confirmed |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | ||
| Reporter: | Robert Varga | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
In order to efficiently propagate state to applications, we want to expose a utility method, which can evaluate a chain of incoming DataTreeCandidates and accurately translate them to a chain of changes to an expression's return values. The way this should work is: XPath xpath = ...; XPathDelta delta = XPathDeltaFactory.initial(xpath); Collection<DataTreeCandiates> candidates = ...; for (DataTreeCandidate c : candidates) { final Optional<XPathResult> res = delta.apply(c); if (res.isPresent()) { // Should not result in duplicates printed LOG.debug("XPath {} changed result to {}", xpath, res.get()); } } // If no state has been applied, this will return Optional.empty() Optional<XPathResult> currentResult = delta.current(); LOG.debug("Current XPath {} result is {}", xpath, currentResult);
|