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