Merge "Bug 1446: Changed QNM to toString listener for debug output"
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / GroupingBuilder.java
index f8ad74d4b624c40d5c6ed1005520146bf07fe117..f186dc3cf386b6d14aee2f25011f8082758f4758 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.yangtools.yang.parser.builder.api;
 
-import org.opendaylight.yangtools.yang.common.QName;
+import java.util.List;
+import java.util.Set;
 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.YangNode;
 
 /**
  * Interface for builders of 'grouping' statement.
@@ -18,9 +18,75 @@ public interface GroupingBuilder extends DataNodeContainerBuilder, SchemaNodeBui
 
     /**
      * Build GroupingDefinition object from this builder.
+     *
+     * @return Instance of {@link GroupingDefinition} described by this builder.
      */
-    GroupingDefinition build(YangNode parent);
+    @Override
+    GroupingDefinition build();
 
-    void setQName(QName qname);
+    /**
+     *
+     * Returns instantiation of grouping child nodes under supplied builder.
+     *
+     * Supplied newParent is not modified.
+     *
+     * For each {@link #getChildNodeBuilders()} new builder is created,
+     * which has supplied new parent set as their {@link Builder#getParent()}
+     * and QNames have updated namespace and revision per supplied parent
+     * node.
+     *
+     * @param newParent Parent node, under which this grouping should be instantiated.
+     * @return List of new builders representing instantiation of this grouping.
+     */
+    List<DataSchemaNodeBuilder> instantiateChildNodes(Builder newParent);
+
+
+   /**
+    *
+    * Returns instantiation of grouping type definitions under supplied builder.
+    *
+    * Supplied newParent is not modified.
+    *
+    * For each {@link #getTypeDefinitionBuilders()} new builder is created,
+    * which has supplied new parent set as their {@link Builder#getParent()}
+    * and QNames have updated namespace and revision per supplied parent
+    * node.
+    *
+    * @param newParent Parent node, under which this grouping should be instantiated.
+    * @return Set of new builders representing instantiation of this grouping.
+    */
+    Set<TypeDefinitionBuilder> instantiateTypedefs(Builder newParent);
+
+   /**
+    *
+    * Returns instantiation of grouping definitions under supplied builder.
+    *
+    * Supplied newParent is not modified.
+    *
+    * For each {@link #getGroupingBuilders()} new builder is created,
+    * which has supplied new parent set as their {@link Builder#getParent()}
+    * and QNames have updated namespace and revision per supplied parent
+    * node.
+    *
+    * @param newParent Parent node, under which this grouping should be instantiated.
+    * @return Set of new builders representing instantiation of this grouping.
+    */
+    Set<GroupingBuilder> instantiateGroupings(Builder newParent);
+
+    /**
+    *
+    * Returns instantiation of unknown nodes under supplied builder.
+    *
+    * Supplied newParent is not modified.
+    *
+    * For each {@link #getUnknownNodes()} new builder is created,
+    * which has supplied new parent set as their {@link Builder#getParent()}
+    * and QNames have updated namespace and revision per supplied parent
+    * node.
+    *
+    * @param newParent Parent node, under which this grouping should be instantiated.
+    * @return Set of new builders representing instantiation of this grouping.
+    */
+    Set<UnknownSchemaNodeBuilder> instantiateUnknownNodes(Builder newParent);
 
 }