API Clarity: Documented o.o.y.yang.parser.builder.api
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / DataNodeContainerBuilder.java
index ecedd8ef489b0a9d033a34d66441aee485e7e536..176bb9496da48980c9b5908d850d46bb8aab3628 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
+ * 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
@@ -10,40 +9,45 @@ package org.opendaylight.yangtools.yang.parser.builder.api;
 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}
+ * <code>augment, case, container,
+ * grouping, list, module, notification</code>.
  */
 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 builders of child nodes.
+     * Returns set of of child node builders.
+     *
+     * This child node builder are build, during invoking {@link #build()} and
+     * added as children to resulting {@link DataNodeContainer}.
      *
      * @return collection child nodes builders
      */
     Set<DataSchemaNodeBuilder> getChildNodeBuilders();
 
     /**
-     * Get child node by name.
+     * Retrieves child node builder by local name.
      *
      * @param name
      *            name of child to seek
@@ -97,20 +101,38 @@ public interface DataNodeContainerBuilder extends Builder {
      */
     void addUsesNode(UsesNodeBuilder usesBuilder);
 
+    /**
+     * Returns set of already built type definitions.
+     *
+     * @return set of already built type definitions.
+     */
     Set<TypeDefinition<?>> getTypeDefinitions();
 
     /**
-     * Get builders of typedef statement defined in this node.
+     * Returns builders of typedef statement defined in this node.
      *
-     * @return typedefBuilder
+     * @return  builders of typedef statement defined in this node.
      */
     Set<TypeDefinitionBuilder> getTypeDefinitionBuilders();
 
     /**
      * Add typedef builder to this node.
      *
-     * @param typedefBuilder
+     * @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();
+
 }