72a12c586071312325f04d94cc89224808255257
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / TypeAwareBuilder.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 org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
13
14 /**
15  * Builder for nodes, which can have 'type' statement must implement this
16  * interface. [typedef, type, leaf, leaf-list, deviate]
17  */
18 public interface TypeAwareBuilder extends Builder {
19
20     QName getTypeQName();
21
22     void setTypeQName(QName qname);
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 resolved type of this node.
40      *
41      * @return type of this node if it is already resolved, null otherwise
42      */
43     TypeDefinition<?> getType();
44
45     /**
46      * Get builder of type of this node.
47      *
48      * @return builder of type of this node or null of this builder has already
49      *         resolved type
50      */
51     TypeDefinitionBuilder getTypedef();
52
53     /**
54      * Set resolved type to this node.
55      *
56      * @param type
57      *            type to set
58      */
59     void setType(TypeDefinition<?> type);
60
61     /**
62      * Set builder of type to this node.
63      *
64      * @param typedef
65      *            builder of type to set
66      */
67     void setTypedef(TypeDefinitionBuilder typedef);
68
69 }