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.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
15 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
17 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
18 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
21 * Common builder for for all YANG {@link DataNodeContainer}
22 * <code>augment, case, container,
23 * grouping, list, module, notification</code>.
25 * @deprecated Pre-Beryllium implementation, scheduled for removal.
28 public interface DataNodeContainerBuilder extends Builder {
31 * Returns QName of this node.
33 * @return QName of this node
38 * Returns Schema path of this node.
40 * @return SchemaPath of this node
45 * Returns list of of child node builders in order they are declared in yang
48 * This child node builder are build, during invoking {@link #build()} and
49 * added as children to resulting {@link DataNodeContainer}.
51 * @return collection child nodes builders
53 List<DataSchemaNodeBuilder> getChildNodeBuilders();
56 * Retrieves child node builder by local name.
59 * name of child to seek
60 * @return child node with given name if present, null otherwise
62 DataSchemaNodeBuilder getDataChildByName(String name);
65 * Add builder of child node to this node.
67 * @param childNode name of child node to add
69 void addChildNode(DataSchemaNodeBuilder childNode);
72 * Add builder of child node to this node at specified position.
74 * @param index position at which the child node will be added
75 * @param childNode name of child node to add at specified position
77 void addChildNode(int index, DataSchemaNodeBuilder childNode);
79 void addChildNode(DataSchemaNode childNode);
81 void addChildNodeToContext(DataSchemaNodeBuilder childNode);
84 * Get already built groupings defined in this node.
86 * @return collection of GroupingDefinition objects
88 Set<GroupingDefinition> getGroupings();
91 * Get builders of groupings defined in this node.
93 * @return collection of grouping builders
95 Set<GroupingBuilder> getGroupingBuilders();
98 * Add builder of grouping statement to this node.
100 * @param groupingBuilder grouping statement builder
102 void addGrouping(GroupingBuilder groupingBuilder);
105 * Get builders of uses defined in this node.
107 * @return collection of uses builders
109 List<UsesNodeBuilder> getUsesNodeBuilders();
112 * Add builder of uses statement to this node.
114 * @param usesBuilder uses statement builder
116 void addUsesNode(UsesNodeBuilder usesBuilder);
119 * Returns set of already built type definitions.
121 * @return set of already built type definitions.
123 Set<TypeDefinition<?>> getTypeDefinitions();
126 * Returns builders of typedef statement defined in this node.
128 * @return builders of typedef statement defined in this node.
130 Set<TypeDefinitionBuilder> getTypeDefinitionBuilders();
133 * Add typedef builder to this node.
135 * @param typedefBuilder
136 * Builder to add to this node.
138 void addTypedef(TypeDefinitionBuilder typedefBuilder);
141 * Returns an instance of product - DataNodeContainer
143 * Returns an instance of data node container with children and properties
144 * constructed as per this builder state, all nested builders are also built
145 * and their product is set to DataNodeContainer.
147 * @return Instance of DataNodeContainer
150 DataNodeContainer build();
153 * Returns map of child nodes of this node. Child nodes should be in same
154 * order as they were defined in yang file.
156 * @return map of child nodes of this node
158 Map<QName, DataSchemaNode> getChildNodes();