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.model.api.YangNode;
17 import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
18 import org.opendaylight.yangtools.yang.parser.util.RefineHolder;
21 * Interface for builders of 'uses' statement.
23 public interface UsesNodeBuilder extends GroupingMember, Builder {
26 * Get parent of this uses node. Since uses can be defined only under on of
27 * module, container, list, case, grouping, input, output, notification or
28 * augment, return type is DataNodeContainerBuilder.
30 DataNodeContainerBuilder getParent();
33 * Get grouping path as string.
35 * @return grouping path as String
37 String getGroupingPathAsString();
42 * @return grouping path as SchemaPath
44 SchemaPath getGroupingPath();
47 * Get grouping definition.
49 * @return GroupingDefinition if present, null otherwise
51 GroupingDefinition getGroupingDefinition();
54 * Set grouping definition.
56 * @param groupingDefinition
57 * GroupingDefinition object
59 void setGroupingDefinition(GroupingDefinition groupingDefinition);
62 * Get grouping builder.
64 * @return GroupingBuilder if present, null otherwise
66 GroupingBuilder getGroupingBuilder();
69 * Set grouping builder.
72 * GroupingBuilder object
74 void setGrouping(GroupingBuilder grouping);
77 * Get information if this uses node is defined in augment.
79 * @return true, if this node is defined under augment statement, false
82 boolean isAugmenting();
85 * Set information if this uses node is defined in augment.
89 void setAugmenting(boolean augmenting);
92 * Get augment under which was this uses node was defined.
94 * Note: This method may return different object than {@link #getParent()}
95 * if this node is a copy of other uses node. If the uses node is copied,
96 * its parent has changed, but parent augment is always same.
99 * @return AugmentationSchemaBuilder under which was this node defined
101 AugmentationSchemaBuilder getParentAugment();
104 * Set augment under which was this uses node was defined.
108 void setParentAugment(AugmentationSchemaBuilder augment);
111 * Get augmentations defined in this uses node.
113 * @return set of augmentations defined in this node
115 Set<AugmentationSchemaBuilder> getAugmentations();
118 * Add augment builder.
121 * new builder of augment statement
123 void addAugment(AugmentationSchemaBuilder builder);
126 * Get refine statements.
128 * @return list of RefineHolder objects
130 List<RefineHolder> getRefines();
135 * @return List of refined SchemaNodeBuilder objects
137 List<SchemaNodeBuilder> getRefineNodes();
140 * Add refine statement.
143 * new RefineHolder object
145 void addRefine(RefineHolder refine);
151 * refined DataSchemaNodeBuilder object
153 void addRefineNode(DataSchemaNodeBuilder refineNode);
156 * Build new UsesNode object.
158 UsesNode build(YangNode parent);
161 * Get child nodes defined in target grouping.
163 * @return set of DataSchemaNodeBuilder objects
165 Set<DataSchemaNodeBuilder> getTargetChildren();
168 * Get groupings defined in target grouping.
170 * @return set of GroupingBuilder objects
172 Set<GroupingBuilder> getTargetGroupings();
175 * Get type definitions defined in target grouping.
177 * @return set of typedefs defined in target grouping
179 Set<TypeDefinitionBuilder> getTargetTypedefs();
182 * Get unknown nodes defined in target grouping.
184 * @return list of unknown nodes defined in target grouping
186 List<UnknownSchemaNodeBuilder> getTargetUnknownNodes();
190 * @return true, if this object was built based on another UsesNodeBuilder,
197 * @return true, if target grouping objects was loaded already, false
200 boolean isDataCollected();
203 * Set if target grouping objects was loaded already.
205 * @param dataCollected
207 void setDataCollected(boolean dataCollected);