Fix minor bug in FRM proactive flow code path
[controller.git] / opendaylight / sal / yang-prototype / yang / 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.Map;
14 import java.util.Set;
15
16 import org.apache.maven.plugin.logging.Log;
17 import org.apache.maven.project.MavenProject;
18 import org.opendaylight.controller.yang.model.api.Module;
19 import org.opendaylight.controller.yang.model.api.SchemaContext;
20
21 /**
22  * Classes implementing this interface can be submitted to maven-yang-plugin's
23  * generate-sources goal.
24  */
25 public interface CodeGenerator {
26
27     /**
28      * Generate sources from provided {@link SchemaContext}
29      *
30      * @param context
31      *            parsed from yang files
32      * @param outputBaseDir
33      *            expected output directory for generated sources configured by
34      *            user
35      * @param currentModules
36      *            yang modules parsed from yangFilesRootDir
37      * @return collection of files that were generated from schema context
38      * @throws IOException
39      */
40     Collection<File> generateSources(SchemaContext context, File outputBaseDir, Set<Module> currentModules)
41             throws IOException;
42
43     /**
44      * Utilize maven logging if necessary
45      *
46      * @param log
47      */
48     void setLog(Log log);
49
50     /**
51      * Provided map contains all configuration that was set in pom for code
52      * generator in additionalConfiguration tag
53      *
54      * @param additionalConfiguration
55      */
56     void setAdditionalConfig(Map<String, String> additionalConfiguration);
57
58     /**
59      * Provided folder is marked as resources and its content will be packaged
60      * in resulting jar. Feel free to add necessary resources
61      *
62      * @param resourceBaseDir
63      */
64     void setResourceBaseDir(File resourceBaseDir);
65
66     /**
67      * Provided maven project object. Any additional information about current
68      * maven project can be accessed from it.
69      *
70      * @param project
71      */
72     void setMavenProject(MavenProject project);
73 }