BUG-865: deprecate pre-Beryllium parser elements
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / RefineBuilder.java
1 /*
2  * Copyright (c) 2014 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.yang.model.api.MustDefinition;
12
13 /**
14  * Mutable holder for information contained in <code>refine</code>
15  *
16  * Represents a local change to node introduced by uses statement
17  * e.g. change in documentation, configuration or properties.
18  *
19  * @deprecated Pre-Beryllium implementation, scheduled for removal.
20  */
21 @Deprecated
22 public interface RefineBuilder extends DocumentedNodeBuilder {
23
24     /**
25      * Get value of config statement.
26      *
27      * @return value of config statement
28      */
29     Boolean isConfiguration();
30
31     /**
32      * Set config statement to the product.
33      *
34      *
35      * @param config true if config true was set, false if config false was set.
36      */
37     void setConfiguration(Boolean config);
38
39     /**
40      * Returns mandatory state of node or NULL if state was not refined.
41      *
42      *
43      * @return mandatory state of node or NULL if state was not refined.
44      */
45     Boolean isMandatory();
46
47     void setMandatory(Boolean mandatory);
48
49     /**
50      *
51      * Returns presence state of refined container.
52      *
53      * @return Presence state of refined container.
54      */
55     Boolean isPresence();
56
57     void setPresence(Boolean presence);
58
59     /**
60      * Returns <code>must</code> definition associated with this builder.
61      *
62      * @return <code>must</code> definition associated with this builder.
63      */
64     MustDefinition getMust();
65
66     /**
67      * Adds must definition to product of this builder.
68      *
69      * @param must <code>must</code> definition which should be associated with parent node.
70      */
71     void setMust(MustDefinition must);
72
73
74     /**
75     *
76     * Returns number of minimum required elements or NULL if minimum elements was not overriden.
77     *
78     * This constraint has meaning only if associated node is list or leaf-list.
79     *
80     * @return number of minimum required elements.
81     */
82    Integer getMinElements();
83
84    /**
85     *
86     * Sets number of minimum required elements.
87     *
88     * This constraint has meaning only if associated node is list or leaf-list.
89     *
90     * @param minElements
91     *            number of minimum required elements.
92     */
93    void setMinElements(Integer minElements);
94
95    /**
96    *
97    * Returns number of maximum elements or NULL if maximum elements was not overriden.
98    *
99    * This constraint has meaning only if associated node is list or leaf-list.
100    *
101    * @return number of maximum required elements.
102    */
103    Integer getMaxElements();
104
105    /**
106    *
107    * Sets number of maximum required elements.
108    *
109    * This constraint has meaning only if associated node is list or leaf-list.
110    *
111    * @param maxElements number of maximum required elements.
112    */
113    void setMaxElements(Integer maxElements);
114
115     /**
116      *
117      * Returns string representation of path to refine target, which is relative to grouping root
118      *
119      * This string representation does not need to contain prefixes, since parent uses
120      * element introduces elements with namespace local to parent module.
121      *
122      * @return string representation of path to refine target, which is relative to grouping root
123      */
124     String getTargetPathString();
125
126     /**
127      *
128      * Returns module (source) name in which refine statement was defined.
129      *
130      * @return module (source) name in which refine statement was defined.
131      */
132     String getModuleName();
133
134     /**
135      * Line on which element was defined.
136      *
137      * @return Line on which element was defined.
138      */
139     int getLine();
140
141     /**
142      * Returns list of unknown schema node builders, which are associated
143      * with refine statement.
144      *
145      * @return Set of unknown schema node builders.
146      */
147     List<UnknownSchemaNodeBuilder> getUnknownNodes();
148
149     /**
150      * Returns string representation of default value or null, if default value was not refined.
151      *
152      * @return  string representation of default value or null, if default value was not refined.
153      */
154     String getDefaultStr();
155
156 }