2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/epl-v10.html
7 package org.opendaylight.yangtools.yang.parser.builder.api;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
13 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
19 * Common builder for for all YANG {@link DataNodeContainer}
20 * <code>augment, case, container,
21 * grouping, list, module, notification</code>.
23 public interface DataNodeContainerBuilder extends Builder {
26 * Returns QName of this node.
28 * @return QName of this node
33 * Returns Schema path of this node.
35 * @return SchemaPath of this node
40 * Returns set of of child node builders.
42 * This child node builder are build, during invoking {@link #build()} and
43 * added as children to resulting {@link DataNodeContainer}.
45 * @return collection child nodes builders
47 Set<DataSchemaNodeBuilder> getChildNodeBuilders();
50 * Retrieves child node builder by local name.
53 * name of child to seek
54 * @return child node with given name if present, null otherwise
56 DataSchemaNodeBuilder getDataChildByName(String name);
59 * Add builder of child node to this node.
63 void addChildNode(DataSchemaNodeBuilder childNode);
65 void addChildNode(DataSchemaNode childNode);
67 void addChildNodeToContext(DataSchemaNodeBuilder childNode);
70 * Get already built groupings defined in this node.
72 * @return collection of GroupingDefinition objects
74 Set<GroupingDefinition> getGroupings();
77 * Get builders of groupings defined in this node.
79 * @return collection of grouping builders
81 Set<GroupingBuilder> getGroupingBuilders();
84 * Add builder of grouping statement to this node.
86 * @param groupingBuilder
88 void addGrouping(GroupingBuilder groupingBuilder);
91 * Get builders of uses defined in this node.
93 * @return collection of uses builders
95 Set<UsesNodeBuilder> getUsesNodeBuilders();
98 * Add builder of uses statement to this node.
102 void addUsesNode(UsesNodeBuilder usesBuilder);
105 * Returns set of already built type definitions.
107 * @return set of already built type definitions.
109 Set<TypeDefinition<?>> getTypeDefinitions();
112 * Returns builders of typedef statement defined in this node.
114 * @return builders of typedef statement defined in this node.
116 Set<TypeDefinitionBuilder> getTypeDefinitionBuilders();
119 * Add typedef builder to this node.
121 * @param typedefBuilder Builder to add to this node.
123 void addTypedef(TypeDefinitionBuilder typedefBuilder);
126 * Returns an instance of product - DataNodeContainer
128 * Returns an instance of data node container with
129 * children and properties constructed as per this builder state,
130 * all nested builders are also built and their product is
131 * set to DataNodeContainer.
133 * @return Instance of DataNodeContainer
136 DataNodeContainer build();
138 Map<QName, DataSchemaNode> getChildNodes();