Refactored yang-maven-plugin. Updated tests.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / maven-yang / src / main / java / org / opendaylight / controller / yang2sources / spi / CodeGenerator.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.yang2sources.spi;
9
10 import java.io.File;
11 import java.io.IOException;
12 import java.util.Collection;
13 import java.util.Set;
14
15 import org.opendaylight.controller.yang.model.api.SchemaContext;
16
17 /**
18  * Classes implementing this interface can be submitted to maven-yang-plugin's
19  * generate-sources goal.
20  */
21 public interface CodeGenerator {
22
23     /**
24      * Generate sources from provided {@link SchemaContext}
25      *
26      * @param context
27      *            parsed from yang files
28      * @param outputBaseDir
29      *            expected output directory for generated sources configured by
30      *            user
31      * @param yangModulesNames
32      *            name of yangs provided by current module
33      * @return collection of files that were generated from schema context
34      * @throws IOException
35      */
36     Collection<File> generateSources(SchemaContext context, File outputBaseDir,
37             Set<String> yangModulesNames) throws IOException;
38 }