When a node is going down, remove edges in both directions associated with the node.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / 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 current line in yang file.
21      *
22      * @return current line in yang file
23      */
24     int getLine();
25
26     /**
27      * Get parent node of this node.
28      *
29      * @return parent node builder or null if this is top level node
30      */
31     Builder getParent();
32
33     /**
34      * Set parent of this node.
35      *
36      * @param parent
37      *            parent node builder
38      */
39     void setParent(Builder parent);
40
41     /**
42      * Add unknown node to this builder.
43      *
44      * @param unknownNode
45      */
46     void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
47
48     /**
49      * Get builders of unknown nodes defined in this node.
50      *
51      * @return collection of UnknownSchemaNodeBuilder objects
52      */
53     List<UnknownSchemaNodeBuilder> getUnknownNodeBuilders();
54
55     /**
56      * Build YANG data model node.
57      *
58      * This method should create an instance of YANG data model node. After
59      * creating an instance, this instance should be returned for each call
60      * without repeating build process.
61      *
62      * @return YANG data model node
63      */
64     Object build();
65
66 }