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