Merge "Clean up yang parser."
[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.model.api.YangNode;
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 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     UsesNode build(YangNode parent);
139
140     boolean isResolved();
141
142     void setResolved(boolean resolved);
143
144 }