BUG-865: deprecate pre-Beryllium parser elements
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / UsesNodeBuilder.java
index f27af6e0cb5dd4215d349a8e4123bc06b64bcdb1..aedeef3ccbb47ecfc43498171d5d31655906f12d 100644 (file)
@@ -9,32 +9,32 @@ package org.opendaylight.yangtools.yang.parser.builder.api;
 
 import java.util.List;
 import java.util.Set;
-
 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UsesNode;
-import org.opendaylight.yangtools.yang.model.api.YangNode;
-import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
-import org.opendaylight.yangtools.yang.parser.util.RefineHolder;
 
 /**
- * Interface for builders of 'uses' statement.
+ * Builder for  'uses' statement.
+ *
+ * @deprecated Pre-Beryllium implementation, scheduled for removal.
  */
-public interface UsesNodeBuilder extends GroupingMember, Builder {
+@Deprecated
+public interface UsesNodeBuilder extends GroupingMember {
 
     /**
      * Get parent of this uses node. Since uses can be defined only under on of
      * module, container, list, case, grouping, input, output, notification or
      * augment, return type is DataNodeContainerBuilder.
      */
+    @Override
     DataNodeContainerBuilder getParent();
 
     /**
-     * Get grouping path as string.
+     * Get target grouping path.
      *
-     * @return grouping path as String
+     * @return target grouping path
      */
-    String getGroupingPathAsString();
+    SchemaPath getTargetGroupingPath();
 
     /**
      * Get grouping path.
@@ -84,29 +84,10 @@ public interface UsesNodeBuilder extends GroupingMember, Builder {
     /**
      * Set information if this uses node is defined in augment.
      *
-     * @param augmenting
+     * @param augmenting information about augmentation
      */
     void setAugmenting(boolean augmenting);
 
-    /**
-     * Get augment under which was this uses node was defined.
-     * <p>
-     * Note: This method may return different object than {@link #getParent()}
-     * if this node is a copy of other uses node. If the uses node is copied,
-     * its parent has changed, but parent augment is always same.
-     * </p>
-     *
-     * @return AugmentationSchemaBuilder under which was this node defined
-     */
-    AugmentationSchemaBuilder getParentAugment();
-
-    /**
-     * Set augment under which was this uses node was defined.
-     *
-     * @param augment
-     */
-    void setParentAugment(AugmentationSchemaBuilder augment);
-
     /**
      * Get augmentations defined in this uses node.
      *
@@ -127,7 +108,7 @@ public interface UsesNodeBuilder extends GroupingMember, Builder {
      *
      * @return list of RefineHolder objects
      */
-    List<RefineHolder> getRefines();
+    List<RefineBuilder> getRefines();
 
     /**
      * Get refined nodes.
@@ -142,7 +123,7 @@ public interface UsesNodeBuilder extends GroupingMember, Builder {
      * @param refine
      *            new RefineHolder object
      */
-    void addRefine(RefineHolder refine);
+    void addRefine(RefineBuilder refine);
 
     /**
      * Add refine node.
@@ -154,56 +135,33 @@ public interface UsesNodeBuilder extends GroupingMember, Builder {
 
     /**
      * Build new UsesNode object.
-     */
-    UsesNode build(YangNode parent);
-
-    /**
-     * Get child nodes defined in target grouping.
      *
-     * @return set of DataSchemaNodeBuilder objects
-     */
-    Set<DataSchemaNodeBuilder> getTargetChildren();
-
-    /**
-     * Get groupings defined in target grouping.
      *
-     * @return set of GroupingBuilder objects
+     * @return UsesNode Instance of {@link UsesNode} described by this builder.
      */
-    Set<GroupingBuilder> getTargetGroupings();
+    @Override
+    UsesNode build();
 
     /**
-     * Get type definitions defined in target grouping.
      *
-     * @return set of typedefs defined in target grouping
-     */
-    Set<TypeDefinitionBuilder> getTargetTypedefs();
-
-    /**
-     * Get unknown nodes defined in target grouping.
+     * Returns true if uses node was resolved and {@link #getGroupingBuilder()}
+     * was instantiated for parent done of this node.
      *
-     * @return list of unknown nodes defined in target grouping
+     * @return true if uses node was resolved and associated nodes were instantiated in parent node.
      */
-    List<UnknownSchemaNodeBuilder> getTargetUnknownNodes();
+    boolean isResolved();
 
     /**
      *
-     * @return true, if this object was built based on another UsesNodeBuilder,
-     *         false otherwise
-     */
-    boolean isCopy();
-
-    /**
+     * Sets state of instantiation of {@link #getGroupingBuilder()}
+     * into parent node of this node.
      *
-     * @return true, if target grouping objects was loaded already, false
-     *         otherwise
-     */
-    boolean isDataCollected();
-
-    /**
-     * Set if target grouping objects was loaded already.
+     * @deprecated Do not use this, this should be internal to the implementation
+     *  and public API contract.
      *
-     * @param dataCollected
+     *  @param resolved resolved
      */
-    void setDataCollected(boolean dataCollected);
+    @Deprecated
+    void setResolved(boolean resolved);
 
 }