Make DataTree take EffectiveModelContext
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTree.java
index 9c9b26d5fb7d19a7f38cdc05b7bf96e24b1de919..378b980dd91b726bbfe353aea5e0fd557709a511 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema.tree;
 
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 /**
@@ -19,9 +20,22 @@ public interface DataTree extends DataTreeTip, ReadOnlyDataTree {
      *
      * @param newSchemaContext new SchemaContext
      * @throws IllegalArgumentException if the new context is incompatible
+     * @throws NullPointerException if newSchemaContext is null
+     * @deprecated Prefer {@link #setEffectiveModelContext(EffectiveModelContext)}.
      */
+    @Deprecated
     void setSchemaContext(SchemaContext newSchemaContext);
 
+    /**
+     * Make the data tree use a new schema context. The context will be used
+     * only by subsequent operations.
+     *
+     * @param newModelContext new EffectiveModelContext
+     * @throws IllegalArgumentException if the new context is incompatible
+     * @throws NullPointerException if newModelContext is null
+     */
+    void setEffectiveModelContext(EffectiveModelContext newModelContext);
+
     /**
      * Commit a data tree candidate.
      *