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.yangtools.yang.model.parser.api;
10 import com.google.common.io.ByteSource;
12 import java.io.IOException;
13 import java.util.Collection;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
17 * Parse yang models and convert data to SchemaContext.
20 public interface YangContextParser extends YangModelParser {
23 * Parse yangFile file and all yang files found in directory.
27 * @param dependenciesDirectory
28 * directory which contains additional yang files
29 * @return parsed data as SchemaContext. Resulting context will contains
30 * only module parsed from yangFile and modules which yangFile needs
33 SchemaContext parseFile(final File yangFile, final File dependenciesDirectory) throws IOException;
36 * Parse one or more Yang model files and return the definitions of Yang
37 * modules defined in *.yang files; <br>
38 * This method SHOULD be used if user need to parse multiple yang models
39 * that are referenced either through import or include statements.
43 * @return parsed data as SchemaContext
45 SchemaContext parseFiles(final Collection<File> yangFiles) throws IOException;
48 * Parse one or more Yang model files and return the definitions of Yang
49 * modules defined in *.yang files. <br>
50 * This method SHOULD be used if user has already parsed context and need to
51 * parse additinal yang models which can have dependencies on models in this
57 * SchemaContext containing already parsed yang models
58 * @return parsed data as SchemaContext
60 SchemaContext parseFiles(final Collection<File> yangFiles, final SchemaContext context) throws IOException;
63 * Parse one or more Yang model streams and return the definitions of Yang
64 * modules defined in *.yang files; <br>
65 * This method SHOULD be used if user need to parse multiple yang models
66 * that are referenced either through import or include statements.
69 * yang streams to parse
70 * @return parsed data as SchemaContext
72 SchemaContext parseSources(final Collection<ByteSource> sources) throws IOException;
75 * Parse one or more Yang model streams and return the definitions of Yang
76 * modules defined in *.yang files. <br>
77 * This method SHOULD be used if user has already parsed context and need to
78 * parse additinal yang models which can have dependencies on models in this
82 * yang streams to parse
84 * SchemaContext containing already parsed yang models
85 * @return parsed data as SchemaContext
87 SchemaContext parseSources(final Collection<ByteSource> sources, final SchemaContext context) throws IOException;