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