Merge "Added RESTCONF constants and draft of JAXRS mapping"
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / UsesNodeBuilder.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 java.util.Set;
12
13 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
15 import org.opendaylight.yangtools.yang.model.api.UsesNode;
16 import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
17 import org.opendaylight.yangtools.yang.parser.util.RefineHolder;
18
19 /**
20  * Interface for builders of 'uses' statement.
21  */
22 public interface UsesNodeBuilder extends GroupingMember, Builder {
23
24     /**
25      * Get parent of this uses node. Since uses can be defined only under on of
26      * module, container, list, case, grouping, input, output, notification or
27      * augment, return type is DataNodeContainerBuilder.
28      */
29     DataNodeContainerBuilder getParent();
30
31     /**
32      * Get grouping path as string.
33      *
34      * @return grouping path as String
35      */
36     String getGroupingPathAsString();
37
38     /**
39      * Get grouping path.
40      *
41      * @return grouping path as SchemaPath
42      */
43     SchemaPath getGroupingPath();
44
45     /**
46      * Get grouping definition.
47      *
48      * @return GroupingDefinition if present, null otherwise
49      */
50     GroupingDefinition getGroupingDefinition();
51
52     /**
53      * Set grouping definition.
54      *
55      * @param groupingDefinition
56      *            GroupingDefinition object
57      */
58     void setGroupingDefinition(GroupingDefinition groupingDefinition);
59
60     /**
61      * Get grouping builder.
62      *
63      * @return GroupingBuilder if present, null otherwise
64      */
65     GroupingBuilder getGroupingBuilder();
66
67     /**
68      * Set grouping builder.
69      *
70      * @param grouping
71      *            GroupingBuilder object
72      */
73     void setGrouping(GroupingBuilder grouping);
74
75     /**
76      * Get information if this uses node is defined in augment.
77      *
78      * @return true, if this node is defined under augment statement, false
79      *         otherwise
80      */
81     boolean isAugmenting();
82
83     /**
84      * Set information if this uses node is defined in augment.
85      *
86      * @param augmenting
87      */
88     void setAugmenting(boolean augmenting);
89
90     /**
91      * Get augment under which was this uses node was defined.
92      * <p>
93      * Note: This method may return different object than {@link #getParent()}
94      * if this node is a copy of other uses node. If the uses node is copied,
95      * its parent has changed, but parent augment is always same.
96      * </p>
97      *
98      * @return AugmentationSchemaBuilder under which was this node defined
99      */
100     AugmentationSchemaBuilder getParentAugment();
101
102     /**
103      * Set augment under which was this uses node was defined.
104      *
105      * @param augment
106      */
107     void setParentAugment(AugmentationSchemaBuilder augment);
108
109     /**
110      * Get augmentations defined in this uses node.
111      *
112      * @return set of augmentations defined in this node
113      */
114     Set<AugmentationSchemaBuilder> getAugmentations();
115
116     /**
117      * Add augment builder.
118      *
119      * @param builder
120      *            new builder of augment statement
121      */
122     void addAugment(AugmentationSchemaBuilder builder);
123
124     /**
125      * Get refine statements.
126      *
127      * @return list of RefineHolder objects
128      */
129     List<RefineHolder> getRefines();
130
131     /**
132      * Get refined nodes.
133      *
134      * @return List of refined SchemaNodeBuilder objects
135      */
136     List<SchemaNodeBuilder> getRefineNodes();
137
138     /**
139      * Add refine statement.
140      *
141      * @param refine
142      *            new RefineHolder object
143      */
144     void addRefine(RefineHolder refine);
145
146     /**
147      * Add refine node.
148      *
149      * @param refineNode
150      *            refined DataSchemaNodeBuilder object
151      */
152     void addRefineNode(DataSchemaNodeBuilder refineNode);
153
154     /**
155      * Build new UsesNode object.
156      */
157     UsesNode build();
158
159     /**
160      * Get child nodes defined in target grouping.
161      *
162      * @return set of DataSchemaNodeBuilder objects
163      */
164     Set<DataSchemaNodeBuilder> getTargetChildren();
165
166     /**
167      * Get groupings defined in target grouping.
168      *
169      * @return set of GroupingBuilder objects
170      */
171     Set<GroupingBuilder> getTargetGroupings();
172
173     /**
174      * Get type definitions defined in target grouping.
175      *
176      * @return set of typedefs defined in target grouping
177      */
178     Set<TypeDefinitionBuilder> getTargetTypedefs();
179
180     /**
181      * Get unknown nodes defined in target grouping.
182      *
183      * @return list of unknown nodes defined in target grouping
184      */
185     List<UnknownSchemaNodeBuilder> getTargetUnknownNodes();
186
187     /**
188      *
189      * @return true, if this object was built based on another UsesNodeBuilder,
190      *         false otherwise
191      */
192     boolean isCopy();
193
194     /**
195      *
196      * @return true, if target grouping objects was loaded already, false
197      *         otherwise
198      */
199     boolean isDataCollected();
200
201     /**
202      * Set if target grouping objects was loaded already.
203      *
204      * @param dataCollected
205      */
206     void setDataCollected(boolean dataCollected);
207
208 }