BUG-865: deprecate pre-Beryllium parser elements
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / 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.yangtools.yang.parser.builder.api;
9
10 import java.util.List;
11 import org.opendaylight.yangtools.concepts.Mutable;
12
13 /**
14  * Parent interface for all builder interfaces.
15  *
16  * @deprecated Pre-Beryllium implementation, scheduled for removal.
17  */
18 @Deprecated
19 public interface Builder extends Mutable {
20
21     /**
22      * Returns name of module in which node created by this builder
23      * was declared.
24      *
25      * @return module name
26      */
27     String getModuleName();
28
29     /**
30      * Get current line in yang file, on which statement
31      * associated with this builder was declared.
32      *
33      * @return current line in yang file
34      */
35     int getLine();
36
37     /**
38      * Returns parent node builder of this node.
39      *
40      * @return parent node builder or null if this is top level node
41      */
42     Builder getParent();
43
44     /**
45      * Set parent of this node.
46      *
47      * @param parent
48      *            parent node builder
49      */
50     void setParent(Builder parent);
51
52     /**
53      * Adds an unknown node builder to this builder.
54      *
55      * When product (child) is builded by the {@link #build()}
56      * method, this builder is also built and unknown node is added
57      * as child to the product of this builder.
58      *
59      * @param unknownNode an unknown node builder
60      */
61     void addUnknownNodeBuilder(UnknownSchemaNodeBuilder unknownNode);
62
63     /**
64      * Get builders of unknown nodes defined in this node.
65      *
66      * @return collection of UnknownSchemaNodeBuilder objects
67      */
68     List<UnknownSchemaNodeBuilder> getUnknownNodes();
69
70     /**
71      * Build YANG data model node.
72      *
73      * This method should create an instance of YANG data model node. After
74      * creating an instance, this instance should be returned for each call
75      * without repeating build process.
76      *
77      * @return YANG data model node
78      */
79     Object build();
80
81 }