2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.yang.model.parser.api;
12 import org.opendaylight.controller.model.api.type.UnknownTypeDefinition;
13 import org.opendaylight.controller.yang.model.api.Module;
14 import org.opendaylight.controller.yang.model.api.SchemaContext;
17 * Yang Model Parser interface is designed for parsing yang models and
18 * convert the information to Data Schema Tree.
21 public interface YangModelParser {
24 * Parse single Yang model file and return the schema definition of Yang
25 * module defined in *.Yang file.
29 * @return the schema definition of Yang module defined in .Yang file.
31 public Module parseYangModel(final String yangFile);
34 * Parse one or more Yang model files and return the definitions of Yang
35 * modules defined in *.Yang files;
37 * This method SHOULD be used if user need to parse multiple yang models
38 * that are referenced either through import or include statements.
40 * @param yangFiles yang files to parse
41 * @return Set of Yang Modules
43 public Set<Module> parseYangModels(final String... yangFiles);
46 * Creates {@link SchemaContext} from specified Modules. The modules SHOULD
47 * not contain any unresolved Schema Nodes or Type Definitions. By
48 * unresolved Schema Nodes or Type Definitions we mean that the Module
49 * should not contain ANY Schema Nodes that contains
50 * {@link UnknownTypeDefinition} and all dependencies although via import or
51 * include definitions are resolved.
55 * @return Schema Context instance constructed from whole Set of Modules.
57 public SchemaContext resolveSchemaContext(final Set<Module> modules);