Fixed resolving of schema path and qname for nodes added by augmentation.
[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     boolean isAugmenting();
76
77     void setAugmenting(boolean augmenting);
78
79     AugmentationSchemaBuilder getParentAugment();
80
81     void setParentAugment(AugmentationSchemaBuilder augment);
82
83     /**
84      * Get augmentations defined in this uses node.
85      *
86      * @return set of augmentations defined in this node
87      */
88     Set<AugmentationSchemaBuilder> getAugmentations();
89
90     /**
91      * Add augment builder.
92      *
93      * @param builder
94      *            new builder of augment statement
95      */
96     void addAugment(AugmentationSchemaBuilder builder);
97
98     /**
99      * Get refine statements.
100      *
101      * @return list of RefineHolder objects
102      */
103     List<RefineHolder> getRefines();
104
105     /**
106      * Get refined nodes.
107      *
108      * @return List of refined SchemaNodeBuilder objects
109      */
110     List<SchemaNodeBuilder> getRefineNodes();
111
112     /**
113      * Add refine statement.
114      *
115      * @param refine
116      *            new RefineHolder object
117      */
118     void addRefine(RefineHolder refine);
119
120     /**
121      * Add refine node.
122      *
123      * @param refineNode
124      *            refined DataSchemaNodeBuilder object
125      */
126     void addRefineNode(DataSchemaNodeBuilder refineNode);
127
128     /**
129      * Build new UsesNode object.
130      */
131     UsesNode build();
132
133     /**
134      * Get child nodes defined in target grouping.
135      *
136      * @return set of DataSchemaNodeBuilder objects
137      */
138     Set<DataSchemaNodeBuilder> getTargetChildren();
139
140     /**
141      * Get groupings defined in target grouping.
142      *
143      * @return set of GroupingBuilder objects
144      */
145     Set<GroupingBuilder> getTargetGroupings();
146
147     /**
148      * Get type definitions defined in target grouping.
149      *
150      * @return set of typedefs defined in target grouping
151      */
152     Set<TypeDefinitionBuilder> getTargetTypedefs();
153
154     /**
155      * Get unknown nodes defined in target grouping.
156      *
157      * @return list of unknown nodes defined in target grouping
158      */
159     List<UnknownSchemaNodeBuilder> getTargetUnknownNodes();
160
161     /**
162      *
163      * @return true, if this object was built based on another UsesNodeBuilder,
164      *         false otherwise
165      */
166     boolean isCopy();
167
168     /**
169      *
170      * @return true, if target grouping objects was loaded already, false
171      *         otherwise
172      */
173     boolean isDataCollected();
174
175     /**
176      * Set if target grouping objects was loaded already.
177      *
178      * @param dataCollected
179      */
180     void setDataCollected(boolean dataCollected);
181
182 }