2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.builder.api;
10 import java.util.List;
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.builder.impl.UnknownSchemaNodeBuilder;
17 import org.opendaylight.yangtools.yang.parser.util.RefineHolder;
20 * Interface for builders of 'uses' statement.
22 public interface UsesNodeBuilder extends GroupingMember, Builder {
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.
29 DataNodeContainerBuilder getParent();
32 * Get grouping path as string.
34 * @return grouping path as String
36 String getGroupingPathAsString();
41 * @return grouping path as SchemaPath
43 SchemaPath getGroupingPath();
46 * Get grouping definition.
48 * @return GroupingDefinition if present, null otherwise
50 GroupingDefinition getGroupingDefinition();
53 * Set grouping definition.
55 * @param groupingDefinition
56 * GroupingDefinition object
58 void setGroupingDefinition(GroupingDefinition groupingDefinition);
61 * Get grouping builder.
63 * @return GroupingBuilder if present, null otherwise
65 GroupingBuilder getGroupingBuilder();
68 * Set grouping builder.
71 * GroupingBuilder object
73 void setGrouping(GroupingBuilder grouping);
76 * Get information if this uses node is defined in augment.
78 * @return true, if this node is defined under augment statement, false
81 boolean isAugmenting();
84 * Set information if this uses node is defined in augment.
88 void setAugmenting(boolean augmenting);
91 * Get augment under which was this uses node was defined.
93 * Note: This method may return different object than {@link #getParent()}
94 * if this node is a copy of other uses node. If the uses node is copied,
95 * its parent has changed, but parent augment is always same.
98 * @return AugmentationSchemaBuilder under which was this node defined
100 AugmentationSchemaBuilder getParentAugment();
103 * Set augment under which was this uses node was defined.
107 void setParentAugment(AugmentationSchemaBuilder augment);
110 * Get augmentations defined in this uses node.
112 * @return set of augmentations defined in this node
114 Set<AugmentationSchemaBuilder> getAugmentations();
117 * Add augment builder.
120 * new builder of augment statement
122 void addAugment(AugmentationSchemaBuilder builder);
125 * Get refine statements.
127 * @return list of RefineHolder objects
129 List<RefineHolder> getRefines();
134 * @return List of refined SchemaNodeBuilder objects
136 List<SchemaNodeBuilder> getRefineNodes();
139 * Add refine statement.
142 * new RefineHolder object
144 void addRefine(RefineHolder refine);
150 * refined DataSchemaNodeBuilder object
152 void addRefineNode(DataSchemaNodeBuilder refineNode);
155 * Build new UsesNode object.
160 * Get child nodes defined in target grouping.
162 * @return set of DataSchemaNodeBuilder objects
164 Set<DataSchemaNodeBuilder> getTargetChildren();
167 * Get groupings defined in target grouping.
169 * @return set of GroupingBuilder objects
171 Set<GroupingBuilder> getTargetGroupings();
174 * Get type definitions defined in target grouping.
176 * @return set of typedefs defined in target grouping
178 Set<TypeDefinitionBuilder> getTargetTypedefs();
181 * Get unknown nodes defined in target grouping.
183 * @return list of unknown nodes defined in target grouping
185 List<UnknownSchemaNodeBuilder> getTargetUnknownNodes();
189 * @return true, if this object was built based on another UsesNodeBuilder,
196 * @return true, if target grouping objects was loaded already, false
199 boolean isDataCollected();
202 * Set if target grouping objects was loaded already.
204 * @param dataCollected
206 void setDataCollected(boolean dataCollected);