Added more descriptive parsing exceptions.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / builder / api / Builder.java
index 51039b12ac48333eac4a2eacc562b6479a0a1900..b849f20d2fb5c4da004ab11be3c6fa334aba0731 100644 (file)
@@ -7,12 +7,74 @@
  */
 package org.opendaylight.controller.yang.parser.builder.api;
 
+import java.util.List;
+
+import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
+
 /**
  * Parent interface for all builder interfaces.
  */
 public interface Builder {
 
-       Object build();
-       int getLine();
+    /**
+     * Get name of module in which this node is declared.
+     *
+     * @return module name
+     */
+    String getModuleName();
+
+    /**
+     * Set name of module in which this node is declared.
+     *
+     * @param moduleName
+     */
+    void setModuleName(String moduleName);
+
+    /**
+     * Get current line in yang file.
+     *
+     * @return current line in yang file
+     */
+    int getLine();
+
+    /**
+     * Get parent node of this node.
+     *
+     * @return parent node builder or null if this is top level node
+     */
+    Builder getParent();
+
+    /**
+     * Set parent of this node.
+     *
+     * @param parent
+     *            parent node builder
+     */
+    void setParent(Builder parent);
+
+    /**
+     * Add unknown node to this builder.
+     *
+     * @param unknownNode
+     */
+    void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
+
+    /**
+     * Get builders of unknown nodes defined in this node.
+     *
+     * @return collection of UnknownSchemaNodeBuilder objects
+     */
+    List<UnknownSchemaNodeBuilder> getUnknownNodeBuilders();
+
+    /**
+     * Build YANG data model node.
+     *
+     * This method should create an instance of YANG data model node. After
+     * creating an instance, this instance should be returned for each call
+     * without repeating build process.
+     *
+     * @return YANG data model node
+     */
+    Object build();
 
 }