X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fbuilder%2Fapi%2FDataNodeContainerBuilder.java;h=fa0693901b9d1b44999d9972fd8c66a62639dc7a;hb=42abb28b99a02f9580f4676ce5c315628e5bcd24;hp=a2ffec1dcf9cd06c6815c3bf8d8b251b30f621af;hpb=f75b7abb9dcc2ba02a14a316212da1c1b434a9b3;p=yangtools.git
diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/DataNodeContainerBuilder.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/DataNodeContainerBuilder.java
index a2ffec1dcf..fa0693901b 100644
--- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/DataNodeContainerBuilder.java
+++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/DataNodeContainerBuilder.java
@@ -7,50 +7,53 @@
*/
package org.opendaylight.yangtools.yang.parser.builder.api;
-import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
-
import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
/**
- * Interface for all yang data-node containers [augment, case, container,
- * grouping, list, module, notification].
+ * Common builder for for all YANG {@link DataNodeContainer}
+ * augment, case, container,
+ * grouping, list, module, notification
.
+ *
+ * @deprecated Pre-Beryllium implementation, scheduled for removal.
*/
+@Deprecated
public interface DataNodeContainerBuilder extends Builder {
/**
- * Get qname of this node.
+ * Returns QName of this node.
*
* @return QName of this node
*/
QName getQName();
/**
- * Get schema path of this node.
+ * Returns Schema path of this node.
*
* @return SchemaPath of this node
*/
SchemaPath getPath();
/**
- * Get already built child nodes.
+ * Returns list of of child node builders in order they are declared in yang
+ * file.
*
- * @return collection of child nodes
- */
- Collection getChildNodes();
-
- /**
- * Get builders of child nodes.
+ * This child node builder are build, during invoking {@link #build()} and
+ * added as children to resulting {@link DataNodeContainer}.
*
* @return collection child nodes builders
*/
- Set getChildNodeBuilders();
+ List getChildNodeBuilders();
/**
- * Get child node by name.
+ * Retrieves child node builder by local name.
*
* @param name
* name of child to seek
@@ -61,12 +64,22 @@ public interface DataNodeContainerBuilder extends Builder {
/**
* Add builder of child node to this node.
*
- * @param childNode
+ * @param childNode name of child node to add
*/
void addChildNode(DataSchemaNodeBuilder childNode);
+ /**
+ * Add builder of child node to this node at specified position.
+ *
+ * @param index position at which the child node will be added
+ * @param childNode name of child node to add at specified position
+ */
+ void addChildNode(int index, DataSchemaNodeBuilder childNode);
+
void addChildNode(DataSchemaNode childNode);
+ void addChildNodeToContext(DataSchemaNodeBuilder childNode);
+
/**
* Get already built groupings defined in this node.
*
@@ -84,7 +97,7 @@ public interface DataNodeContainerBuilder extends Builder {
/**
* Add builder of grouping statement to this node.
*
- * @param groupingBuilder
+ * @param groupingBuilder grouping statement builder
*/
void addGrouping(GroupingBuilder groupingBuilder);
@@ -93,19 +106,26 @@ public interface DataNodeContainerBuilder extends Builder {
*
* @return collection of uses builders
*/
- Set getUsesNodes();
+ List getUsesNodeBuilders();
/**
* Add builder of uses statement to this node.
*
- * @param usesBuilder
+ * @param usesBuilder uses statement builder
*/
void addUsesNode(UsesNodeBuilder usesBuilder);
/**
- * Get builders of typedef statement defined in this node.
+ * Returns set of already built type definitions.
*
- * @return typedefBuilder
+ * @return set of already built type definitions.
+ */
+ Set> getTypeDefinitions();
+
+ /**
+ * Returns builders of typedef statement defined in this node.
+ *
+ * @return builders of typedef statement defined in this node.
*/
Set getTypeDefinitionBuilders();
@@ -113,7 +133,28 @@ public interface DataNodeContainerBuilder extends Builder {
* Add typedef builder to this node.
*
* @param typedefBuilder
+ * Builder to add to this node.
*/
void addTypedef(TypeDefinitionBuilder typedefBuilder);
+ /**
+ * Returns an instance of product - DataNodeContainer
+ *
+ * Returns an instance of data node container with children and properties
+ * constructed as per this builder state, all nested builders are also built
+ * and their product is set to DataNodeContainer.
+ *
+ * @return Instance of DataNodeContainer
+ */
+ @Override
+ DataNodeContainer build();
+
+ /**
+ * Returns map of child nodes of this node. Child nodes should be in same
+ * order as they were defined in yang file.
+ *
+ * @return map of child nodes of this node
+ */
+ Map getChildNodes();
+
}