Merge "When a node is going down, remove edges in both directions associated with...
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / builder / api / Builder.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.yang.parser.builder.api;
9
10 import java.util.List;
11
12 import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
13
14 /**
15  * Parent interface for all builder interfaces.
16  */
17 public interface Builder {
18
19     /**
20      * Get name of module in which this node is declared.
21      *
22      * @return module name
23      */
24     String getModuleName();
25
26     /**
27      * Set name of module in which this node is declared.
28      *
29      * @param moduleName
30      */
31     void setModuleName(String moduleName);
32
33     /**
34      * Get current line in yang file.
35      *
36      * @return current line in yang file
37      */
38     int getLine();
39
40     /**
41      * Get parent node of this node.
42      *
43      * @return parent node builder or null if this is top level node
44      */
45     Builder getParent();
46
47     /**
48      * Set parent of this node.
49      *
50      * @param parent
51      *            parent node builder
52      */
53     void setParent(Builder parent);
54
55     /**
56      * Add unknown node to this builder.
57      *
58      * @param unknownNode
59      */
60     void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
61
62     /**
63      * Get builders of unknown nodes defined in this node.
64      *
65      * @return collection of UnknownSchemaNodeBuilder objects
66      */
67     List<UnknownSchemaNodeBuilder> getUnknownNodeBuilders();
68
69     /**
70      * Build YANG data model node.
71      *
72      * This method should create an instance of YANG data model node. After
73      * creating an instance, this instance should be returned for each call
74      * without repeating build process.
75      *
76      * @return YANG data model node
77      */
78     Object build();
79
80 }