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.
19 * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactory} and related classes
23 public interface YangContextParser extends YangModelParser {
26 * Parse yangFile file and all yang files found in directory.
30 * @param dependenciesDirectory
31 * directory which contains additional yang files
32 * @return parsed data as SchemaContext. Resulting context will contains
33 * only module parsed from yangFile and modules which yangFile needs
36 SchemaContext parseFile(final File yangFile, final File dependenciesDirectory) throws IOException, YangSyntaxErrorException;
39 * Parse one or more Yang model files and return the definitions of Yang
40 * modules defined in *.yang files; <br>
41 * This method SHOULD be used if user need to parse multiple yang models
42 * that are referenced either through import or include statements.
46 * @return parsed data as SchemaContext
48 SchemaContext parseFiles(final Collection<File> yangFiles) throws IOException;
51 * Parse one or more Yang model files and return the definitions of Yang
52 * modules defined in *.yang files. <br>
53 * This method SHOULD be used if user has already parsed context and need to
54 * parse additinal yang models which can have dependencies on models in this
60 * SchemaContext containing already parsed yang models
61 * @return parsed data as SchemaContext
63 SchemaContext parseFiles(final Collection<File> yangFiles, final SchemaContext context) throws IOException, YangSyntaxErrorException;
66 * Parse one or more Yang model streams and return the definitions of Yang
67 * modules defined in *.yang files; <br>
68 * This method SHOULD be used if user need to parse multiple yang models
69 * that are referenced either through import or include statements.
72 * yang streams to parse
73 * @return parsed data as SchemaContext
75 SchemaContext parseSources(final Collection<ByteSource> sources) throws IOException, YangSyntaxErrorException;
78 * Parse one or more Yang model streams and return the definitions of Yang
79 * modules defined in *.yang files. <br>
80 * This method SHOULD be used if user has already parsed context and need to
81 * parse additinal yang models which can have dependencies on models in this
85 * yang streams to parse
87 * SchemaContext containing already parsed yang models
88 * @return parsed data as SchemaContext
90 SchemaContext parseSources(final Collection<ByteSource> sources, final SchemaContext context) throws IOException, YangSyntaxErrorException;