5b17b1a9dfa4e22ddb0df5320a23330212463755
[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 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
14 import org.opendaylight.yangtools.yang.model.api.UsesNode;
15
16 /**
17  * Builder for  'uses' statement.
18  */
19 public interface UsesNodeBuilder extends GroupingMember {
20
21     /**
22      * Get parent of this uses node. Since uses can be defined only under on of
23      * module, container, list, case, grouping, input, output, notification or
24      * augment, return type is DataNodeContainerBuilder.
25      */
26     @Override
27     DataNodeContainerBuilder getParent();
28
29     /**
30      * Get target grouping path.
31      *
32      * @return target grouping path
33      */
34     SchemaPath getTargetGroupingPath();
35
36     /**
37      * Get grouping path.
38      *
39      * @return grouping path as SchemaPath
40      */
41     SchemaPath getGroupingPath();
42
43     /**
44      * Get grouping definition.
45      *
46      * @return GroupingDefinition if present, null otherwise
47      */
48     GroupingDefinition getGroupingDefinition();
49
50     /**
51      * Set grouping definition.
52      *
53      * @param groupingDefinition
54      *            GroupingDefinition object
55      */
56     void setGroupingDefinition(GroupingDefinition groupingDefinition);
57
58     /**
59      * Get grouping builder.
60      *
61      * @return GroupingBuilder if present, null otherwise
62      */
63     GroupingBuilder getGroupingBuilder();
64
65     /**
66      * Set grouping builder.
67      *
68      * @param grouping
69      *            GroupingBuilder object
70      */
71     void setGrouping(GroupingBuilder grouping);
72
73     /**
74      * Get information if this uses node is defined in augment.
75      *
76      * @return true, if this node is defined under augment statement, false
77      *         otherwise
78      */
79     boolean isAugmenting();
80
81     /**
82      * Set information if this uses node is defined in augment.
83      *
84      * @param augmenting information about augmentation
85      */
86     void setAugmenting(boolean augmenting);
87
88     /**
89      * Get augmentations defined in this uses node.
90      *
91      * @return set of augmentations defined in this node
92      */
93     Set<AugmentationSchemaBuilder> getAugmentations();
94
95     /**
96      * Add augment builder.
97      *
98      * @param builder
99      *            new builder of augment statement
100      */
101     void addAugment(AugmentationSchemaBuilder builder);
102
103     /**
104      * Get refine statements.
105      *
106      * @return list of RefineHolder objects
107      */
108     List<RefineBuilder> getRefines();
109
110     /**
111      * Get refined nodes.
112      *
113      * @return List of refined SchemaNodeBuilder objects
114      */
115     List<SchemaNodeBuilder> getRefineNodes();
116
117     /**
118      * Add refine statement.
119      *
120      * @param refine
121      *            new RefineHolder object
122      */
123     void addRefine(RefineBuilder refine);
124
125     /**
126      * Add refine node.
127      *
128      * @param refineNode
129      *            refined DataSchemaNodeBuilder object
130      */
131     void addRefineNode(DataSchemaNodeBuilder refineNode);
132
133     /**
134      * Build new UsesNode object.
135      *
136      *
137      * @return UsesNode Instance of {@link UsesNode} described by this builder.
138      */
139     @Override
140     UsesNode build();
141
142     /**
143      *
144      * Returns true if uses node was resolved and {@link #getGroupingBuilder()}
145      * was instantiated for parent done of this node.
146      *
147      * @return true if uses node was resolved and associated nodes were instantiated in parent node.
148      */
149     boolean isResolved();
150
151     /**
152      *
153      * Sets state of instantiation of {@link #getGroupingBuilder()}
154      * into parent node of this node.
155      *
156      * @deprecated Do not use this, this should be internal to the implementation
157      *  and public API contract.
158      *
159      *  @param resolved resolved
160      */
161     @Deprecated
162     void setResolved(boolean resolved);
163
164 }