Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-711

XPath: provide an evaluator on top of DataTreeCandidate

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

      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);
      

       

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: