Added generation of Transfer Objects from Type Definitions.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-api / src / main / java / org / opendaylight / controller / yang / model / parser / api / YangModelParser.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.model.parser.api;
9
10 import java.io.File;
11 import java.io.InputStream;
12 import java.util.List;
13 import java.util.Set;
14
15 import org.opendaylight.controller.yang.model.api.Module;
16 import org.opendaylight.controller.yang.model.api.SchemaContext;
17 import org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition;
18
19 /**
20  * Yang Model Parser interface is designed for parsing yang models and convert
21  * the information to Data Schema Tree.
22  *
23  */
24 public interface YangModelParser {
25
26     /**
27      * Parse one or more Yang model files and return the definitions of Yang
28      * modules defined in *.Yang files; <br>
29      * This method SHOULD be used if user need to parse multiple yang models
30      * that are referenced either through import or include statements.
31      *
32      * @param yangFiles
33      *            yang files to parse
34      * @return Set of Yang Modules
35      */
36     public Set<Module> parseYangModels(final List<File> yangFiles);
37     
38     public Set<Module> parseYangModelsFromStreams(
39             final List<InputStream> yangModelStreams);
40
41     /**
42      * Creates {@link SchemaContext} from specified Modules. The modules SHOULD
43      * not contain any unresolved Schema Nodes or Type Definitions. By
44      * unresolved Schema Nodes or Type Definitions we mean that the Module
45      * should not contain ANY Schema Nodes that contains
46      * {@link UnknownTypeDefinition} and all dependencies although via import or
47      * include definitions are resolved.
48      *
49      * @param modules
50      *            Set of Yang Modules
51      * @return Schema Context instance constructed from whole Set of Modules.
52      */
53     public SchemaContext resolveSchemaContext(final Set<Module> modules);
54 }