Yang parser refactoring.
[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  * Interface for builders of '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     DataNodeContainerBuilder getParent();
29
30     /**
31      * Get grouping path as string.
32      *
33      * @return grouping path as String
34      */
35     String getGroupingPathAsString();
36
37     /**
38      * Get grouping path.
39      *
40      * @return grouping path as SchemaPath
41      */
42     SchemaPath getGroupingPath();
43
44     /**
45      * Get grouping definition.
46      *
47      * @return GroupingDefinition if present, null otherwise
48      */
49     GroupingDefinition getGroupingDefinition();
50
51     /**
52      * Set grouping definition.
53      *
54      * @param groupingDefinition
55      *            GroupingDefinition object
56      */
57     void setGroupingDefinition(GroupingDefinition groupingDefinition);
58
59     /**
60      * Get grouping builder.
61      *
62      * @return GroupingBuilder if present, null otherwise
63      */
64     GroupingBuilder getGroupingBuilder();
65
66     /**
67      * Set grouping builder.
68      *
69      * @param grouping
70      *            GroupingBuilder object
71      */
72     void setGrouping(GroupingBuilder grouping);
73
74     /**
75      * Get information if this uses node is defined in augment.
76      *
77      * @return true, if this node is defined under augment statement, false
78      *         otherwise
79      */
80     boolean isAugmenting();
81
82     /**
83      * Set information if this uses node is defined in augment.
84      *
85      * @param augmenting
86      */
87     void setAugmenting(boolean augmenting);
88
89     /**
90      * Get augmentations defined in this uses node.
91      *
92      * @return set of augmentations defined in this node
93      */
94     Set<AugmentationSchemaBuilder> getAugmentations();
95
96     /**
97      * Add augment builder.
98      *
99      * @param builder
100      *            new builder of augment statement
101      */
102     void addAugment(AugmentationSchemaBuilder builder);
103
104     /**
105      * Get refine statements.
106      *
107      * @return list of RefineHolder objects
108      */
109     List<RefineHolder> getRefines();
110
111     /**
112      * Get refined nodes.
113      *
114      * @return List of refined SchemaNodeBuilder objects
115      */
116     List<SchemaNodeBuilder> getRefineNodes();
117
118     /**
119      * Add refine statement.
120      *
121      * @param refine
122      *            new RefineHolder object
123      */
124     void addRefine(RefineHolder refine);
125
126     /**
127      * Add refine node.
128      *
129      * @param refineNode
130      *            refined DataSchemaNodeBuilder object
131      */
132     void addRefineNode(DataSchemaNodeBuilder refineNode);
133
134     /**
135      * Build new UsesNode object.
136      */
137     UsesNode build();
138
139     boolean isResolved();
140
141     void setResolved(boolean resolved);
142
143 }