Implemented ordering of yang module data nodes. Added Comparators utility class.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / builder / api / Builder.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.controller.yang.parser.builder.api;
9
10 import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
11
12 /**
13  * Parent interface for all builder interfaces.
14  */
15 public interface Builder {
16
17     /**
18      * Get current line in yang file.
19      *
20      * @return current line in yang file
21      */
22     int getLine();
23
24     /**
25      * Get parent node of this node.
26      *
27      * @return parent node builder or null if this is top level node
28      */
29     Builder getParent();
30
31     /**
32      * Set parent of this node.
33      *
34      * @param parent
35      *            parent node builder
36      */
37     void setParent(Builder parent);
38
39     /**
40      * Build YANG data model node.
41      *
42      * This method should create an instance of YANG data model node. After
43      * creating an instance, this instance should be returned for each call
44      * without repeating build process.
45      *
46      * @return YANG data model node
47      */
48     Object build();
49
50     void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode);
51
52 }