Merge "API Clarity: Documented o.o.y.yang.parser.builder.api"
[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.util.RefineHolder;
17
18 /**
19  * Builder for  'uses' statement.
20  */
21 public interface UsesNodeBuilder extends GroupingMember {
22
23     /**
24      * Get parent of this uses node. Since uses can be defined only under on of
25      * module, container, list, case, grouping, input, output, notification or
26      * augment, return type is DataNodeContainerBuilder.
27      */
28     @Override
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 augmentations defined in this uses node.
92      *
93      * @return set of augmentations defined in this node
94      */
95     Set<AugmentationSchemaBuilder> getAugmentations();
96
97     /**
98      * Add augment builder.
99      *
100      * @param builder
101      *            new builder of augment statement
102      */
103     void addAugment(AugmentationSchemaBuilder builder);
104
105     /**
106      * Get refine statements.
107      *
108      * @return list of RefineHolder objects
109      */
110     List<RefineHolder> getRefines();
111
112     /**
113      * Get refined nodes.
114      *
115      * @return List of refined SchemaNodeBuilder objects
116      */
117     List<SchemaNodeBuilder> getRefineNodes();
118
119     /**
120      * Add refine statement.
121      *
122      * @param refine
123      *            new RefineHolder object
124      */
125     void addRefine(RefineHolder refine);
126
127     /**
128      * Add refine node.
129      *
130      * @param refineNode
131      *            refined DataSchemaNodeBuilder object
132      */
133     void addRefineNode(DataSchemaNodeBuilder refineNode);
134
135     /**
136      * Build new UsesNode object.
137      *
138      *
139      * @return UsesNode Instance of {@link UsesNode} described by this builder.
140      */
141     @Override
142     UsesNode build();
143
144     /**
145      *
146      * Returns true if uses node was resolved and {@link #getGroupingBuilder()}
147      * was instantiated for parent done of this node.
148      *
149      * @return true if uses node was resolved and associated nodes were instantiated in parent node.
150      */
151     boolean isResolved();
152
153     /**
154      *
155      * Sets state of instantiation of {@link #getGroupingBuilder()}
156      * into parent node of this node.
157      *
158      * @deprecated Do not use this, this should be internal to the implementation
159      *  and public API contract.
160      */
161     @Deprecated
162     void setResolved(boolean resolved);
163
164 }