Added support for parsing submodules & added dependency utility parser
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / DataNodeContainerBuilder.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.Set;
11
12 import org.opendaylight.yangtools.yang.common.QName;
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;
17
18 /**
19  * Interface for all yang data-node containers [augment, case, container,
20  * grouping, list, module, notification].
21  */
22 public interface DataNodeContainerBuilder extends Builder {
23
24     /**
25      * Get qname of this node.
26      *
27      * @return QName of this node
28      */
29     QName getQName();
30
31     /**
32      * Get schema path of this node.
33      *
34      * @return SchemaPath of this node
35      */
36     SchemaPath getPath();
37
38     /**
39      * Get builders of child nodes.
40      *
41      * @return collection child nodes builders
42      */
43     Set<DataSchemaNodeBuilder> getChildNodeBuilders();
44
45     /**
46      * Get child node by name.
47      *
48      * @param name
49      *            name of child to seek
50      * @return child node with given name if present, null otherwise
51      */
52     DataSchemaNodeBuilder getDataChildByName(String name);
53
54     /**
55      * Add builder of child node to this node.
56      *
57      * @param childNode
58      */
59     void addChildNode(DataSchemaNodeBuilder childNode);
60
61     void addChildNode(DataSchemaNode childNode);
62
63     void addChildNodeToContext(DataSchemaNodeBuilder childNode);
64
65     /**
66      * Get already built groupings defined in this node.
67      *
68      * @return collection of GroupingDefinition objects
69      */
70     Set<GroupingDefinition> getGroupings();
71
72     /**
73      * Get builders of groupings defined in this node.
74      *
75      * @return collection of grouping builders
76      */
77     Set<GroupingBuilder> getGroupingBuilders();
78
79     /**
80      * Add builder of grouping statement to this node.
81      *
82      * @param groupingBuilder
83      */
84     void addGrouping(GroupingBuilder groupingBuilder);
85
86     /**
87      * Get builders of uses defined in this node.
88      *
89      * @return collection of uses builders
90      */
91     Set<UsesNodeBuilder> getUsesNodeBuilders();
92
93     /**
94      * Add builder of uses statement to this node.
95      *
96      * @param usesBuilder
97      */
98     void addUsesNode(UsesNodeBuilder usesBuilder);
99
100     Set<TypeDefinition<?>> getTypeDefinitions();
101
102     /**
103      * Get builders of typedef statement defined in this node.
104      *
105      * @return typedefBuilder
106      */
107     Set<TypeDefinitionBuilder> getTypeDefinitionBuilders();
108
109     /**
110      * Add typedef builder to this node.
111      *
112      * @param typedefBuilder
113      */
114     void addTypedef(TypeDefinitionBuilder typedefBuilder);
115
116 }