Deprecate preliminary XPath/NormalizedNode interfaces 34/80934/7
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Mar 2019 00:26:22 +0000 (01:26 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Mar 2019 14:12:04 +0000 (15:12 +0100)
We have our own XPath parser implementation, which allows introspection
into the content and allows further transformations.

The APIs in yang.data.api.schema.xpath assume the XPath parser and
evaluator are kept in the same artifact, which does not work well
with the need to parse XPaths in yang-model-api context and then
evaluating them either in yang-model-api context or in yang-data-api
context.

This patch deprecates those APIs and creates a staging artifact for
APIs which integrate with yang-xpath-api.

yang-data-jaxen is relegated to an experimental feature, pending its
update to the newly-defined APIs.

JIRA: YANGTOOLS-967
Change-Id: I661d50e7024fad3e3bc1f06d8650e506bc061fb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
28 files changed:
artifacts/pom.xml
features/features-yangtools-experimental/pom.xml
features/odl-yangtools-exp-data-xpath-api/pom.xml [new file with mode: 0644]
features/odl-yangtools-exp-data-xpath/pom.xml [new file with mode: 0644]
features/odl-yangtools-xpath-api/pom.xml
features/odl-yangtools-xpath/pom.xml
features/pom.xml
yang/pom.xml
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/LazyXPathExpression.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/OptimizableXPathExpression.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/PrefixConverters.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/RelocatableXPathExpression.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathBooleanResult.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathDocument.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathExpression.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathNodesetResult.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathNumberResult.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathResult.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathSchemaContext.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathSchemaContextFactory.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/XPathStringResult.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/package-info.java [new file with mode: 0644]
yang/yang-data-jaxen/pom.xml
yang/yang-data-xpath-api/pom.xml [new file with mode: 0644]
yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/DataTreeCandidateDocument.java [new file with mode: 0644]
yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/NormalizedNodeDocument.java [new file with mode: 0644]
yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/XPathDocument.java [new file with mode: 0644]
yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/package-info.java [new file with mode: 0644]

index caf2f3ca4ef5cf4b950993990c19a1907d4ae623..bfb17aece7cac3d56aae29fb608dd11318f55a1a 100644 (file)
                 <artifactId>yang-data-api</artifactId>
                 <version>3.0.0-SNAPSHOT</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-data-xpath-api</artifactId>
+                <version>0.1.0-SNAPSHOT</version>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-data-impl</artifactId>
                 <type>xml</type>
                 <classifier>features</classifier>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>odl-yangtools-exp-data-xpath-api</artifactId>
+                <version>0.1.0-SNAPSHOT</version>
+                <type>xml</type>
+                <classifier>features</classifier>
+            </dependency>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>odl-yangtools-exp-data-xpath</artifactId>
+                <version>0.1.0-SNAPSHOT</version>
+                <type>xml</type>
+                <classifier>features</classifier>
+            </dependency>
 
             <!-- Experimental features -->
 
index 4b61bcd79de8206a44fc06da320f1d10608dd022..4808763b2667f5771d8c8245e1ba3b330476d104 100644 (file)
             <classifier>features</classifier>
             <type>xml</type>
         </dependency>
+
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-exp-data-xpath-api</artifactId>
+            <classifier>features</classifier>
+            <type>xml</type>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-exp-data-xpath</artifactId>
+            <classifier>features</classifier>
+            <type>xml</type>
+        </dependency>
     </dependencies>
 </project>
diff --git a/features/odl-yangtools-exp-data-xpath-api/pom.xml b/features/odl-yangtools-exp-data-xpath-api/pom.xml
new file mode 100644 (file)
index 0000000..b8c5e8c
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2016 Red Hat, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>single-feature-parent</artifactId>
+        <version>4.0.9</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.yangtools</groupId>
+    <artifactId>odl-yangtools-exp-data-xpath-api</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <packaging>feature</packaging>
+    <name>OpenDaylight :: Yangtools :: Experimental :: Data XPath API</name>
+    <description>YANG-modeled data XPath APIs</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yangtools-artifacts</artifactId>
+                <version>3.0.0-SNAPSHOT</version>
+                <scope>import</scope>
+                <type>pom</type>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-data-api</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-xpath-api</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-xpath-api</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/features/odl-yangtools-exp-data-xpath/pom.xml b/features/odl-yangtools-exp-data-xpath/pom.xml
new file mode 100644 (file)
index 0000000..514b7ed
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2016 Red Hat, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>single-feature-parent</artifactId>
+        <version>4.0.9</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.yangtools</groupId>
+    <artifactId>odl-yangtools-exp-data-xpath</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <packaging>feature</packaging>
+    <name>OpenDaylight :: Yangtools :: Experimental :: Data XPath support</name>
+    <description>XPath support for YANG-modeled data</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yangtools-artifacts</artifactId>
+                <version>3.0.0-SNAPSHOT</version>
+                <scope>import</scope>
+                <type>pom</type>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-xpath</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-exp-data-xpath-api</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-jaxen</artifactId>
+        </dependency>
+    </dependencies>
+</project>
index 2ccdcf1bd3e38ffc0424a906ff4338182325f2ff..74788bbde133a89695f8da7e928c2fcd993b0bec 100644 (file)
@@ -20,7 +20,7 @@
     <artifactId>odl-yangtools-xpath-api</artifactId>
     <version>1.0.0-SNAPSHOT</version>
     <packaging>feature</packaging>
-    <name>OpenDaylight :: Yangtools :: Experimental :: XPath API</name>
+    <name>OpenDaylight :: Yangtools :: XPath API</name>
 
     <dependencyManagement>
         <dependencies>
index 00659e5f3554fa05b5c114fa7946c79027c33dfa..810638df1ce7877342b9487413f971457df1f8b1 100644 (file)
@@ -21,7 +21,7 @@
     <version>3.0.0-SNAPSHOT</version>
     <packaging>feature</packaging>
     <name>OpenDaylight :: Yangtools :: XPath support</name>
-    <description>XPath support for YANG-modeled data</description>
+    <description>YANG XPath support</description>
 
     <dependencyManagement>
         <dependencies>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>odl-yangtools-data-api</artifactId>
-            <type>xml</type>
-            <classifier>features</classifier>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>odl-yangtools-xpath-api</artifactId>
@@ -58,9 +52,5 @@
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-xpath-impl</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-jaxen</artifactId>
-        </dependency>
     </dependencies>
 </project>
index 5087a96cd2eac8659fb35c1dc50fc9a92407599e..dc01f897cc12b034fcc439aae490915d54a0df5c 100644 (file)
@@ -39,6 +39,8 @@
         <module>features-yangtools</module>
 
         <!-- Experimental features -->
+        <module>odl-yangtools-exp-data-xpath-api</module>
+        <module>odl-yangtools-exp-data-xpath</module>
 
         <!-- Experimental feature repostitory -->
         <module>features-yangtools-experimental</module>
index 8db619d45240b54f707ebfbebaf414c14c0e2b33..1980bba7b7e13ffaed5fa2e7411aa2ca61d35b3e 100644 (file)
@@ -25,6 +25,7 @@
     <modules>
         <module>yang-common</module>
         <module>yang-data-api</module>
+        <module>yang-data-xpath-api</module>
         <module>yang-data-jaxen</module>
         <module>yang-data-util</module>
         <module>yang-data-impl</module>
index 90faba1eca037bce0a6c2925fda50df099152a99..1ce5256b8e754ccc8c133ecdb2f922e53cda3c11 100644 (file)
@@ -27,8 +27,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  *             APPLICATIONS WILLING TO USE THIS API PLEASE CONTACT
  *             <a href="mailto:yangtools-dev@lists.opendaylight.org">yangtools-dev</a>.
  */
-@Beta
 @Deprecated
+@Beta
 public interface LazyXPathExpression {
     /**
      * Evaluate this expression at the specified path in a document. If evaluation succeeds, it will return an
index 72d6e346e147921c65f98aa1a3ff6246c3c08174..ca404128ea71c2556bff2afee2b2166690b9fe1c 100644 (file)
@@ -22,6 +22,7 @@ import javax.annotation.Nonnull;
  * the expression.
  */
 @Beta
+@Deprecated
 public interface OptimizableXPathExpression extends XPathExpression {
     /**
      * Perform optimization of this expression. If an implementation supports different levels of optimization, it
index 215dd9d1b325947982a5968925dc15014643dd9e..50a3575e59d85eb761a5f820a8a302a401140c48 100644 (file)
@@ -27,6 +27,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
  * A set of utility functions for dealing with common types of namespace mappings.
  */
 @Beta
+@Deprecated
 public final class PrefixConverters {
     private PrefixConverters() {
         throw new UnsupportedOperationException();
index 3f0663e68ab11974e08b40cdb70a05e6b4e750a7..79c389cffb4062c0e7862beb951f13bd64df9676 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * moved either up or down in a SchemaPath tree, usually closer to their {@link #getApexPath()}.
  */
 @Beta
+@Deprecated
 public interface RelocatableXPathExpression extends XPathExpression {
     /**
      * Return a new XPathExpression relocated to a SchemaPath of the implementation's choosing. Note that
index f4a9d5cd44962db047756618860deb3ca908c040..4b8c5f3d6c0c3ab9f600c0550e23d1c1ea0ba6c4 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.annotations.Beta;
  * An {@link XPathResult} containing a Boolean.
  */
 @Beta
+@Deprecated
 public interface XPathBooleanResult extends XPathResult<Boolean> {
 
 }
index 2cb9cfbfbfa011db23813ac7a9b8c16497048d29..05d5ff39e7f2b7fd092b26338f7cf8fd5988a810 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * The notion of a document, modeled as a {@link NormalizedNode}.
  */
 @Beta
+@Deprecated
 public interface XPathDocument {
     /**
      * Return the root node of this document.
index 8c3c8d254bb82eabbafefaad4d2ce273b221824d..4d129ffe3818c8d5c35bbdd7d80b021d0b0ebd2a 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * evaluated on {@link XPathDocument}s from other context.
  */
 @Beta
+@Deprecated
 public interface XPathExpression {
     /**
      * Evaluate this expression at the specified path in a document. If evaluation succeeds, it will return an
index 8be30d60b17085c11ec85317bece5d2b2e42ef4e..8d11f8f36e2fd4bf51677a0243a4d57fdc1a47ef 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * {@link YangInstanceIdentifier}.
  */
 @Beta
+@Deprecated
 public interface XPathNodesetResult
     extends XPathResult<Collection<Entry<YangInstanceIdentifier, NormalizedNode<?, ?>>>> {
 
index ce3a71423dad6f2cd91fcae4f21c7345c63ba72b..7564a27125911d9e487d1ae5543584e93e76b7a8 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.annotations.Beta;
  * An {@link XPathResult} containing a Number.
  */
 @Beta
+@Deprecated
 public interface XPathNumberResult extends XPathResult<Number> {
 
 }
index 366f22153b9e7dfa4d2cf939e036e53bb35f095c..f1c6c0642f1468063c910d12ba1bbc00ce36436d 100644 (file)
@@ -16,6 +16,7 @@ import javax.annotation.Nonnull;
  * @param <T> type of returned value
  */
 @Beta
+@Deprecated
 // FIXME: do we want to support all the modes of
 //        <a href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResultType">DOM XPath</a> ?
 //        The default DataTree (yang-data-impl) implementation can support ORDERED_NODE_SNAPSHOT_TYPE. The clustered
index 0f8541a738e56bde6435ae755cacc1450d063fba..f0e1b5adf5adf80f3b9911d5f531876977a51848 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * a particular root node.
  */
 @Beta
+@Deprecated
 public interface XPathSchemaContext {
     /**
      * Compile an XPath expression for execution on {@link XPathDocument}s produced by this context.
index 06669747c55e9ecfd76d3281ec5f7e857358c473..60ba0c9d17a0d0d770481e8f25b38add4ab2b0a0 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
  * <p>
  * Implementations are required to support {@link java.util.ServiceLoader}.
  */
+@Deprecated
 @NonNullByDefault
 public interface XPathSchemaContextFactory {
     /**
index 75a1b9224665bd9c3271e57de7bd6d49ed484152..55cb1ec12bc4ad1cac84250dc1fe2602e92e1329 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.annotations.Beta;
  * An {@link XPathResult} containing a String.
  */
 @Beta
+@Deprecated
 public interface XPathStringResult extends XPathResult<String> {
 
 }
diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/package-info.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/xpath/package-info.java
new file mode 100644 (file)
index 0000000..442093a
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+/**
+ * Deprecated APIs for evaluating XPath expressions on
+ * {@link org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode} trees.
+ *
+ * <p>
+ * This API is deprecated and will be removed in a future version. For replacement refer to
+ * {@code org.opendaylight.yang.data.api.xpath} package.
+ */
+@java.lang.Deprecated
+package org.opendaylight.yangtools.yang.data.api.schema.xpath;
\ No newline at end of file
index 67b5fce3912e5ea048739b390fde10fdb5bb0433..de8e5922ed9115a228c3afb917bdc75ffa4e8b81 100644 (file)
@@ -34,7 +34,7 @@
 
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-api</artifactId>
+            <artifactId>yang-data-xpath-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
diff --git a/yang/yang-data-xpath-api/pom.xml b/yang/yang-data-xpath-api/pom.xml
new file mode 100644 (file)
index 0000000..cf86563
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../../bundle-parent</relativePath>
+    </parent>
+
+    <artifactId>yang-data-xpath-api</artifactId>
+    <packaging>bundle</packaging>
+    <version>0.1.0-SNAPSHOT</version>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>util</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.yangtools</groupId>
+          <artifactId>yang-data-api</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.yangtools</groupId>
+          <artifactId>yang-xpath-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/DataTreeCandidateDocument.java b/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/DataTreeCandidateDocument.java
new file mode 100644 (file)
index 0000000..90d70cc
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api.xpath;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
+
+/**
+ * An {@link XPathDocument} bound to a {@link DataTreeCandidate}.
+ *
+ * @author Robert Varga
+ */
+@Beta
+public interface DataTreeCandidateDocument extends XPathDocument<DataTreeCandidate> {
+
+}
diff --git a/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/NormalizedNodeDocument.java b/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/NormalizedNodeDocument.java
new file mode 100644 (file)
index 0000000..239cc1b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api.xpath;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+
+/**
+ * An {@link XPathDocument} bound to a {@link NormalizedNode} tree.
+ *
+ * @author Robert Varga
+ */
+@Beta
+public interface NormalizedNodeDocument extends XPathDocument<NormalizedNode<?, ?>> {
+
+}
diff --git a/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/XPathDocument.java b/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/XPathDocument.java
new file mode 100644 (file)
index 0000000..4614732
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api.xpath;
+
+import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNull;
+
+/**
+ * The notion of a W3C documented bound to a specific object model. This binding is expressed in terms of the document
+ * exposing a root node from the object model.
+ *
+ * <p>
+ * This interface is not meant to be used directly. Refer to its specializations like {@link NormalizedNodeDocument}
+ * and {@link DataTreeCandidateDocument}.
+ *
+ * @param <T> Object model node type
+ * @author Robert Varga
+ */
+@Beta
+public interface XPathDocument<T> {
+    /**
+     * Return the root node of this document.
+     *
+     * @return This document's root node.
+     */
+    @NonNull T getRootNode();
+}
diff --git a/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/package-info.java b/yang/yang-data-xpath-api/src/main/java/org/opendaylight/yangtools/yang/data/api/xpath/package-info.java
new file mode 100644 (file)
index 0000000..973da3e
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+/**
+ * Experimental support for evaluating {@link org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression}s on top
+ * of {@link org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode} trees.
+ *
+ * @author Robert Varga
+ */
+package org.opendaylight.yangtools.yang.data.api.xpath;
\ No newline at end of file